diff --git a/ikc3/configure b/ikc3/configure
index 5c08e6e..f8f2e78 100755
--- a/ikc3/configure
+++ b/ikc3/configure
@@ -29,7 +29,7 @@ PROG_DEBUG=ikc3_debug
. ./sources.sh
# Common config for all targets
-CFLAGS="$CFLAGS -W -Wall -Werror -std=c11 -pedantic -fPIC"
+CFLAGS="$CFLAGS -W -Wall -Werror -std=c11 -pedantic -fPIC -pthread"
LDFLAGS="$LDFLAGS -rdynamic"
config_asan
config_gnu
@@ -40,7 +40,7 @@ pkg_config libmd
config_lib libmd -lmd 2>/dev/null
config_lib dl -ldl 2>/dev/null
pkg_config wineditline
-LIBS="$LIBS -pthread"
+LIBS="$LIBS"
if pkg-config wineditline; then
echo "#define HAVE_WINEDITLINE 1" >> ${CONFIG_H}
diff --git a/kc3s/configure b/kc3s/configure
index 7b37223..10121e7 100755
--- a/kc3s/configure
+++ b/kc3s/configure
@@ -43,7 +43,7 @@ OBJECTS_DEBUG="$(c2ext .debug.lo "$SOURCES")"
echo "OBJECTS_DEBUG = $OBJECTS_DEBUG" >> ${CONFIG_MK}
# Common config for all targets
-CFLAGS="$CFLAGS -W -Wall -Werror -std=c11 -pedantic -pipe"
+CFLAGS="$CFLAGS -W -Wall -Werror -std=c11 -pedantic -pipe -pthread"
LDFLAGS="$LDFLAGS -rdynamic"
config_asan
config_gnu
@@ -53,7 +53,7 @@ pkg_config libffi
pkg_config libmd
config_lib libmd -lmd 2>/dev/null
config_lib dl -ldl 2>/dev/null
-LIBS="$LIBS -pthread -lm"
+LIBS="$LIBS -lm"
# Asan config
CFLAGS_ASAN="$CFLAGS -DDEBUG -O1 -g"
diff --git a/libkc3/configure b/libkc3/configure
index 08eb99f..5b74099 100755
--- a/libkc3/configure
+++ b/libkc3/configure
@@ -41,7 +41,7 @@ OBJECTS_DEBUG="$(c2ext .debug.lo "$LO_SOURCES")"
# Common config for all targets
CFLAGS="$CFLAGS -W -Wall -Werror -std=c11 -pedantic -pipe -pthread"
-LDFLAGS="-export-dynamic $LDFLAGS -rdynamic -pthread"
+LDFLAGS="-export-dynamic $LDFLAGS -rdynamic"
config_asan
config_gnu
config_i386
@@ -56,7 +56,7 @@ config_define PREFIX "\"${PREFIX}\""
config_have_crypt_newhash
config_have_stat_mtim
update_config_h
-LIBS="$LIBS -lm -pthread -rpath ${PREFIX}/lib"
+LIBS="$LIBS -lm -lpthread -rpath ${PREFIX}/lib"
if ! [ -f ../ucd2c/ucd.c ]; then
touch ../ucd2c/ucd.c
diff --git a/test/configure b/test/configure
index 8d38eb6..72aba84 100755
--- a/test/configure
+++ b/test/configure
@@ -43,7 +43,7 @@ echo "OBJECTS_DEBUG = $OBJECTS_DEBUG" >> ${CONFIG_MK}
# Common config for all targets
CPPFLAGS="$CPPFLAGS -I.."
CFLAGS="$CFLAGS -W -Wall -Werror -std=c11 -pedantic -pipe -pthread"
-LDFLAGS="$LDFLAGS -rdynamic -pthread"
+LDFLAGS="$LDFLAGS -rdynamic"
config_asan
config_gnu
config_i386
@@ -52,7 +52,7 @@ pkg_config libffi
pkg_config libmd
config_lib libmd -lmd 2>/dev/null
config_lib dl -ldl 2>/dev/null
-LIBS="$LIBS -pthread -lm"
+LIBS="$LIBS -lpthread -lm"
# Asan config
CPPFLAGS_ASAN="$CPPFLAGS"