On some systems that use system modules to load packages, the env. variables are usually set correctly to find the needed library. Therefore, we should not require the variable to be set (for example, --with-hdf5 -...). Make fails when these variables are not set.
Work around is to search around for where the needed libraries are installed and setting the paths at configure time.