Fix building of tests, and building libpkg under some cases

/usr/bin/ld: //usr/lib/libssl.so.7: invalid DSO for symbol `SSL_load_error_strings' definition

Issue:	#989