Fix bug #64293	

The problem is because of a change in pgkconfig 0.28 that trims the output of
pkg-config --cflags-only-I openssl.

This cause the 'if test -n "$OPENSSL_LIBS" && test -n "$OPENSSL_INCS"; then' to
fail and -lssl is no longer passed to the build.

Splitting the check in two resolves the issue.