Use ${CMAKE_DL_LIBS} instead of dl for library dependencies