hard-stops for with-libjpeg and/or with-libtiff

Check for header files and libraries instead of trying to check for packages.