Add CMAKE_DL_LIBS for the tests which depends on FLTK. See http://www.flightgear.org/forums/viewtopic.php?f=45&t=19743&sid=c2e14c52b2d692e91661097ca1d7a2bf&start=15 and this http://trac.osgeo.org/qgis/ticket/1939 for more info and explanation.