--- kbuild-0.1.9998.3499/src/kmk/Makefile.kmk
+++ kbuild-0.1.9998.3499/src/kmk/Makefile.kmk
@@ -60,9 +60,9 @@
 ifneq ($(KBUILD_TARGET),os2)
  TEMPLATE_BIN-KMK_INCS += glob
 endif
-TEMPLATE_BIN-KMK_LIBS       = $(LIB_KUTIL) $(TEMPLATE_BIN-THREADED_LIBS) $(kmkmissing_1_TARGET) $(LIB_KUTIL)
-TEMPLATE_BIN-KMK_LIBS.x86   = $(LIB_KUTIL) $(TEMPLATE_BIN-THREADED_LIBS.x86)
-TEMPLATE_BIN-KMK_LIBS.amd64 = $(LIB_KUTIL) $(TEMPLATE_BIN-THREADED_LIBS.amd64)
+TEMPLATE_BIN-KMK_LIBS       = $(LIB_KUTIL) $(TEMPLATE_BIN-THREADED_LIBS) $(kmkmissing_1_TARGET) $(LIB_KUTIL) pthread
+TEMPLATE_BIN-KMK_LIBS.x86   = $(LIB_KUTIL) $(TEMPLATE_BIN-THREADED_LIBS.x86) pthread
+TEMPLATE_BIN-KMK_LIBS.amd64 = $(LIB_KUTIL) $(TEMPLATE_BIN-THREADED_LIBS.amd64) pthread
 ifdef ELECTRIC_HEAP # for electric heap (see electric.c).
 ifeq ($(KBUILD_TARGET),win)
  TEMPLATE_BIN-KMK_CFLAGS = $(TEMPLATE_BIN-THREADED_CFLAGS) /FI$(kmk_DEFPATH)/electric.h -DELECTRIC_HEAP=1