diff -Nru a/sntp/m4/openldap-thread-check.m4 b/sntp/m4/openldap-thread-check.m4
--- a/sntp/m4/openldap-thread-check.m4	2024-05-19 18:38:30 +0000
+++ b/sntp/m4/openldap-thread-check.m4	2024-05-19 18:38:30 +0000
@@ -262,10 +262,8 @@
 				dnl save the flags
 				AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 #include <pthread.h>
-#ifndef NULL
-#define NULL (void*)0
-#endif
-]], [[pthread_detach(NULL);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no])
+pthread_t thread;
+]], [[pthread_detach(thread);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no])
 			])
 
 			if test $ol_cv_func_pthread_detach = no ; then
