You can look for header files and library files when compiling configuration files, and pass them through the C preprocessor and linker in the form of non-standard additions. As shown below:
CPPFLAGS=-I/path/to/include LDFLAGS=-L/path/to/library ./configure
If you use csh and compatible Shell scripts as your login script, then Should be set to:
env CPPFLAGS=-I/path/to/include LDFLAGS=-L/path/to/library ./configure