Try setting LD_LIBRARY_PATH, which is similar to PATH for libraries. For instance:
LD_LIBRARY_PATH = $ HOME / lib: $ LD_LIBRARY_PATH export LD_LIBRARY_PATH
For more information on library path variables, see here.
Environment variables that specifically affect how the configure script pass arguments for compilation are LIBS and LD_FLAGS. bash./configure --help mentions them.
And as you mentioned in the comments, LIBRARY_PATH also needs to be set. See LD_LIBRARY_PATH vs LIBRARY_PATH for an explanation of the difference.
source share