autotools: fails build when need but can not find openssl (cherry picked from commit 53b3be4ee9e814a22876675c0ee004f0ebfb8535)