added more explicit checking for libs to CMake build