diff --git a/c3s/configure b/c3s/configure
index aa45181..4478b88 100755
--- a/c3s/configure
+++ b/c3s/configure
@@ -51,8 +51,7 @@ LIBS="${LIBS:=-lm}"
# Common config for all targets
CFLAGS="$CFLAGS -W -Wall -Werror -std=c99 -pedantic"
CPPFLAGS="$CPPFLAGS -I../libffi/include"
-LDFLAGS="-L../libffi/.libs/ $LDFLAGS"
-LIBS="$LIBS -lffi"
+LIBS="$LIBS ../libffi/.libs/libffi.a"
config_asan
config_gnu
pkg_config libbsd-overlay
diff --git a/ic3/configure b/ic3/configure
index b7b9506..38c0db3 100755
--- a/ic3/configure
+++ b/ic3/configure
@@ -51,8 +51,7 @@ LIBS="${LIBS:=-lm}"
# Common config for all targets
CFLAGS="$CFLAGS -W -Wall -Werror -std=c99 -pedantic"
CPPFLAGS="$CPPFLAGS -I../libffi/include"
-LDFLAGS="-L../libffi/.libs/ $LDFLAGS"
-LIBS="$LIBS -lffi"
+LIBS="$LIBS ../libffi/.libs/libffi.a"
config_asan
config_gnu
pkg_config libbsd-overlay
diff --git a/test/configure b/test/configure
index af18696..bab8834 100755
--- a/test/configure
+++ b/test/configure
@@ -51,8 +51,7 @@ LIBS="${LIBS:=} -lm"
# Common config for all targets
CFLAGS="$CFLAGS -W -Wall -Werror -std=c99 -pedantic"
CPPFLAGS="$CPPFLAGS -I../libffi/include"
-LDFLAGS="-L../libffi/.libs/ $LDFLAGS"
-LIBS="$LIBS -lffi"
+LIBS="$LIBS ../libffi/.libs/libffi.a"
config_asan
config_gnu
pkg_config libbsd-overlay