build UPDATE libcrypt does not exist on MacOS

Refs #394
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d3608e9..ba1b56c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -251,12 +251,12 @@
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNC_ENABLED_SSH")
 
     # crypt
-    if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "QNX")
-        target_link_libraries(netconf2 -lcrypt)
-        list(APPEND CMAKE_REQUIRED_LIBRARIES crypt)
-    else()
+    if(${CMAKE_SYSTEM_NAME} MATCHES "QNX")
         target_link_libraries(netconf2 -llogin)
         list(APPEND CMAKE_REQUIRED_LIBRARIES login)
+    elseif(NOT APPLE)
+        target_link_libraries(netconf2 -lcrypt)
+        list(APPEND CMAKE_REQUIRED_LIBRARIES crypt)
     endif()
 
     # libpam