Fix ExternalProjectPatched to handle .bz2 and long download times.
Remove wget dependencies in cmake files.
Add dependency checks in cmake files. #3143

Check for the following programs/libraries and fail at configuration
time if they're required but missing:
libpam, bison, flex, autoconf, automake, libtoolize, perl Archive::Tar,
perl Digest::MD5, libcurl, libltdl, libxml2, libexpat, libuuid, libdl.a
Fix some externals to build with newer versions of gcc.
Fix a cmake message parameter name.