diff --git a/Makefile.am.template b/Makefile.am.template
index e187be26bd9310332fc14259f4d1ef5aaa7852be..00130d1cd6657b50ea24af872812d9ad6bb788fa 100644
--- a/Makefile.am.template
+++ b/Makefile.am.template
@@ -32,7 +32,7 @@ pkgconfig_DATA += alberta-fem%LIBCODE%.pc
 noinst_LTLIBRARIES += $(assemble%LIBCODE%_libs)
 
 libalberta_fem%LIBCODE%_la_SOURCES = $(common_fem_sources)
-libalberta_fem%LIBCODE%_la_LIBADD = $(assemble%LIBCODE%_libs) @GPSKCA_ALL_LIBS@ 
+libalberta_fem%LIBCODE%_la_LIBADD = $(assemble%LIBCODE%_libs) @GPSKCA_ALL_LIBS@ @DYLOADER_LIBS@
 libalberta_fem%LIBCODE%_la_CPPFLAGS = \
  $(CPPFLAGS) -DDIM_OF_WORLD=%DIM_OF_WORLD% \
  -DALBERTA_DEBUG=%ALBERTA_DEBUG% \
@@ -128,8 +128,8 @@ alberta-fem%LIBCODE%.pc: $(top_builddir)/alberta-fem.pctmpl Makefile
 alberta-gfx%LIBCODE%.pc: $(top_builddir)/alberta-gfx.pctmpl Makefile
 	$(SED) -e 's/!DIMENSION!/%DIM_OF_WORLD%/g' -e 's/!LIBCODE!/$(LIBCODE)/g' -e 's/!SUFFIX!/$(SUFFIX)/g' $< > $@
 
-distclean-local:
-	-rm -f $(BUILT_SOURCES)
+%NO_MULTI_DIM%distclean-local:
+%NO_MULTI_DIM%	-rm -f $(BUILT_SOURCES)
 
 %NO_MULTI_DIM%if MAINTAINER_MODE
 %NO_MULTI_DIM%$(srcdir)/Makefile.am: \
diff --git a/configure.ac b/configure.ac
index 9fa43c3b66afa388f270a28cbd6dece16376ba60..07a5ee96277913d479147065f668611afc77f3c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -660,6 +660,7 @@ ALBERTA_ENABLE_FLAG([fem-toolbox],
   ALBERTA_FEM_TOOLBOX,
   [SUBST cond define])
 
+DYLOADER_LIBS=""
 if test "${ALBERTA_FEM_TOOLBOX}" = 1; then
 ALBERTA_ENABLE_FLAG([graphics],
   [disable support for visualization, including all add-ons which need graphics.],
@@ -667,7 +668,10 @@ ALBERTA_ENABLE_FLAG([graphics],
   ALBERTA_USE_GRAPHICS,
   [SUBST cond define])
   # Check for libltdl
-  AC_CHECK_LIB([ltdl],[lt_dlinit])
+  AC_CHECK_LIB([ltdl],[lt_dlinit],
+  [AC_DEFINE(HAVE_LIBLTDL, 1, [Define to 1 if libtldl is available])
+DYLOADER_LIBS="-lltdl"
+  ])
   AC_CHECK_HEADERS([ltdl.h])
 else
   AM_CONDITIONAL(ALBERTA_USE_GRAPHICS, false)
@@ -676,6 +680,7 @@ else
   AC_DEFINE(HAVE_LIBLTDL, 0, [])
   AC_DEFINE(HAVE_LTDL_H, 0, [])
 fi
+AC_SUBST(DYLOADER_LIBS)
 
 if test "${ALBERTA_USE_GRAPHICS}" = 1; then
 #