--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -121,7 +121,11 @@
 
 ADD_LIBRARY(libsift STATIC ${LIBSIFT_SOURCES})
 
-set(all_libs libsift ${JPEG_LIBRARIES} ${TIFF_LIBRARIES}
+if (UNIX)
+    FIND_LIBRARY(MATH_LIBRARIES NAMES m PATHS /usr/lib /usr/local/lib )
+endif (UNIX)
+
+set(all_libs libsift ${JPEG_LIBRARIES} ${TIFF_LIBRARIES} ${MATH_LIBRARIES}
     ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${PANO13_LIBRARIES} ${LIBXML2_LIBRARIES}) 
 
 add_executable(generatekeys GenerateKeys.c)