(maint) Fix build dependency finding to support CMake hint variables.

Adding back support for a \<packagename\>_ROOT CMake variable that
gives a hint to where dependencies can be located.

Also adding support for \<packagename\>_INCLUDEDIR for an include
directory hint and a \<packagename\>_LIBRARYDIR for a library
directory hint.