[2.0] Fix various problems with the build system.

1. Fix pkg-config not being used for OpenSSL on non-FreeBSD systems.
2. Add a work around for trampling over PKG_CONFIG_PATH.