openssl: Add proper configure check and make sure to link to the library