The library directory was often wrong because the default for CMAKE_INSTALL_LIBDIR is lib and not lib64.