--- ./src/threads/CMakeLists.txt
+++ ./src/threads/CMakeLists.txt
@@ -24,30 +24,12 @@ if (WITH_STATIC_LIB)
 endif (WITH_STATIC_LIB)
 
 set(LIBSSH_THREADS_LINK_LIBRARIES
-    ${LIBSSH_SHARED_LIBRARY}
-)
-
-set(libssh_threads_SRCS
-)
-
-# build and link pthread
-if (CMAKE_USE_PTHREADS_INIT)
-    set(libssh_threads_SRCS
-        ${libssh_threads_SRCS}
-        pthread.c
-    )
-
-    set(LIBSSH_THREADS_LINK_LIBRARIES
-        ${LIBSSH_THREADS_LINK_LIBRARIES}
-        ${CMAKE_THREAD_LIBS_INIT}
-    )
-endif (CMAKE_USE_PTHREADS_INIT)
-
-set(LIBSSH_THREADS_LINK_LIBRARIES
-  ${LIBSSH_THREADS_LINK_LIBRARIES}
+  ${LIBSSH_SHARED_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}
   CACHE INTERNAL "libssh threads link libraries"
 )
 
+set(libssh_threads_SRCS pthread.c)
+
 include_directories(
   ${LIBSSH_THREADS_PUBLIC_INCLUDE_DIRS}
   ${LIBSSH_THREADS_PRIVATE_INCLUDE_DIRS}



