Recently I was building ntl from source which was needed for barvinok. After building ntl, I specified the ntl install prefix as argument to configure command but the configure command kept saying:

./configure --enable-shared-barvinok --prefix=$HOME --with-ntl-prefix=../ntl-install-dir
...
checking for main in -lntl... no
configure: error: Need ntl

The problem was ntl needs pthread and the configure command actually wasn’t able to compile the test program because of lack of -lpthread option. Explicit LDFLAGS fixed the issue.

LDFLAGS='-lpthread' ./configure --enable-shared-barvinok --prefix=$HOME --with-ntl-prefix=../ntl-install-dir

Happy coding!