diff --git a/m4/dune_all.m4 b/m4/dune_all.m4
index 64373b3abaa7525e7690736d4a53bb97a4cad1bd..91a02f74a09569fa0c216033cacba52d0871ebf9 100644
--- a/m4/dune_all.m4
+++ b/m4/dune_all.m4
@@ -32,7 +32,7 @@ dnl do not use LT_INIT since we want to be compatible with libtool 1.5
   AC_REQUIRE([DUNE_CHECK_MOD_DEPENDENCIES])
 
   # convenience-variables if every found package should be used
-  AC_SUBST([ALL_PKG_LIBS], "$ALL_PKG_LIBS $DUNE_PKG_LIBS $LIBS")
+  AC_SUBST([ALL_PKG_LIBS], "$DUNE_PKG_LIBS $ALL_PKG_LIBS $LIBS")
   AC_SUBST([ALL_PKG_LDFLAGS], "$LDFLAGS $DUNE_PKG_LDFLAGS $ALL_PKG_LDFLAGS")
   AC_SUBST([ALL_PKG_CPPFLAGS], "$CPPFLAGS $DUNE_PKG_CPPFLAGS $ALL_PKG_CPPFLAGS")