should use ${CMAKE_DL_LIBS} in place of -dl (fix #49)