Jeronimo Zucco writes:
export LDFLAGS="-L/usr/local/openssl/lib"
Note that if you've built dynamic OpenSSL libraries as well, you may need to put -R<path> or -Wl,-rpath,<path> in LDFLAGS in addition to -L<path>. -L to look up libraries at compile time, -R or rpath at run-time.