  if ENABLE_STATIC
  xtables_multi_CFLAGS  += -DALL_INCLUSIVE
  endif
-@@ -14,22 +15,25 @@ if ENABLE_IPV4
+@@ -16,23 +17,26 @@ if ENABLE_IPV4
  xtables_multi_SOURCES += iptables-save.c iptables-restore.c \
                           iptables-standalone.c iptables.c
  xtables_multi_CFLAGS  += -DENABLE_IPV4
 -xtables_multi_LDADD   += ../libiptc/libip4tc.la ../extensions/libext4.a
-+xtables_multi_LDADD   += ${top_builddir}/libiptc/libip4tc.la
-+xtables_multi_LDFLAGS += -liptext4
++xtables_multi_LDADD   += ../libiptc/libip4tc.la
++xtables_multi_LDFLAGS += -L${top_builddir}/extensions -liptext4
  endif
  if ENABLE_IPV6
  xtables_multi_SOURCES += ip6tables-save.c ip6tables-restore.c \
                            ip6tables-standalone.c ip6tables.c
  xtables_multi_CFLAGS  += -DENABLE_IPV6
 -xtables_multi_LDADD   += ../libiptc/libip6tc.la ../extensions/libext6.a
-+xtables_multi_LDADD   += ${top_builddir}/libiptc/libip6tc.la
-+xtables_multi_LDFLAGS += -liptext6
++xtables_multi_LDADD   += ../libiptc/libip6tc.la
++xtables_multi_LDFLAGS += -L${top_builddir}/extensions -liptext6
  endif
  xtables_multi_SOURCES += xshared.c
 -xtables_multi_LDADD   += ../libxtables/libxtables.la -lm

Index: iptables-1.6.0/extensions/GNUmakefile.in
===================================================================
--- iptables-1.6.0.orig/extensions/GNUmakefile.in
+++ iptables-1.6.0/extensions/GNUmakefile.in
@@ -49,11 +49,33 @@ pfb_build_mod := $(filter-out @blacklist
 pfa_build_mod := $(filter-out @blacklist_modules@ @blacklist_a_modules@,${pfa_build_mod})
 pf4_build_mod := $(filter-out @blacklist_modules@ @blacklist_4_modules@,${pf4_build_mod})
 pf6_build_mod := $(filter-out @blacklist_modules@ @blacklist_6_modules@,${pf6_build_mod})

 if ENABLE_STATIC
 xtables_compat_multi_CFLAGS  += -DALL_INCLUSIVE
 endif
@@ -45,11 +49,12 @@ xtables_compat_multi_SOURCES += xtables-
 				getethertype.c nft-bridge.c \
 				xtables-eb-standalone.c xtables-eb.c \
 				xtables-translate.c
-xtables_compat_multi_LDADD   += ${libmnl_LIBS} ${libnftnl_LIBS} ${libnetfilter_conntrack_LIBS} ../extensions/libext4.a ../extensions/libext6.a ../extensions/libext_ebt.a ../extensions/libext_arpt.a
+xtables_compat_multi_LDADD   += ${libmnl_LIBS} ${libnftnl_LIBS} ${libnetfilter_conntrack_LIBS}
+xtables_compat_multi_LDFLAGS += -liptext4 -liptext6 -liptext_ebt -liptext_arpt
 # yacc and lex generate dirty code
 xtables_compat_multi-xtables-config-parser.o xtables_compat_multi-xtables-config-syntax.o: AM_CFLAGS += -Wno-missing-prototypes -Wno-missing-declarations -Wno-implicit-function-declaration -Wno-nested-externs -Wno-undef -Wno-redundant-decls
 xtables_compat_multi_SOURCES += xshared.c
