Fix missing -ldl in CMAKE_EXE_FLAGS.