Add pthread to CMake sem_wait check. Fixes #53

Some systems have sem_wait in librt, some in libpthread.
This add pthread to the CMake check for semaphore support.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7563533..7cb8ca8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -144,9 +144,9 @@
     add_definitions (-DNN_HAVE_GETADDRINFO_A)
 endif ()
 
-list (APPEND CMAKE_REQUIRED_LIBRARIES rt)
+list (APPEND CMAKE_REQUIRED_LIBRARIES rt pthread)
 check_symbol_exists (sem_wait semaphore.h NN_HAVE_SEMAPHORE)
-list (REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES rt)
+list (REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES rt pthread)
 if (NN_HAVE_SEMAPHORE)
     add_definitions (-DNN_HAVE_SEMAPHORE)
 endif()