diff --git a/ChangeLog b/ChangeLog
index dd68a29..8c21ff6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2010-09-12  6.6.4-6 Cristy  <quetzlzacatenango@image...>
   * Do not break words if caption size is absolute (reference
     http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=17123).
+  * Don't define HAVE_THREADS for --without-threads configure script option.
 
 2010-09-20  6.6.4-5 Nicolas Robidoux <nicolas.robidoux@gmail...>
   * Modified "magick/resize.c" so that MagickPIL is a MagickRealType number.
diff --git a/configure b/configure
index 2bc6047..7685fa8 100755
--- a/configure
+++ b/configure
@@ -8170,7 +8170,7 @@
         ;;
 
 	*-darwin*)
-	acx_pthread_flags="-pthread $acx_pthread_flags"
+	ax_pthread_flags="-pthread $ax_pthread_flags"
 	;;
 esac
 
@@ -8263,10 +8263,10 @@
 main ()
 {
 pthread_t th; pthread_attr_t attr;
+                     pthread_create(&th,0,start_routine,0);
                      pthread_join(th, 0);
                      pthread_attr_init(&attr);
                      pthread_cleanup_push(routine, 0);
-                     pthread_create(&th,0,start_routine,0);
                      pthread_cleanup_pop(0);
   ;
   return 0;
diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4
index bdae477..164391e 100644
--- a/m4/ax_pthread.m4
+++ b/m4/ax_pthread.m4
@@ -75,7 +75,7 @@
 #   modified version of the Autoconf Macro, you may extend this special
 #   exception to the GPL to apply to your modified version as well.
 
-#serial 7
+#serial 9
 
 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
 AC_DEFUN([AX_PTHREAD], [
@@ -154,7 +154,7 @@
         ;;
 
 	*-darwin*)
-	acx_pthread_flags="-pthread $acx_pthread_flags"
+	ax_pthread_flags="-pthread $ax_pthread_flags"
 	;;
 esac
 
@@ -202,10 +202,10 @@
 	             static void routine(void* a) {a=0;}
 	             static void* start_routine(void* a) {return a;}],
                     [pthread_t th; pthread_attr_t attr;
+                     pthread_create(&th,0,start_routine,0);
                      pthread_join(th, 0);
                      pthread_attr_init(&attr);
                      pthread_cleanup_push(routine, 0);
-                     pthread_create(&th,0,start_routine,0);
                      pthread_cleanup_pop(0); ],
                     [ax_pthread_ok=yes])