Reorganized cmake build system

The system now uses the find_package utility from cmake to find the as
many libraries we need as possible. Removed incomplete support for
compilers other than GCC.