diff --git a/Makefile.am b/Makefile.am
index 8ccf55b4deec5b154147c546136e6a8079f528bf..024e8536980902e04a319b35bab0611f5dd0eaa0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -39,6 +39,7 @@ clean-local:
 
 distclean-local:
 	-rm -rf $(DEMO)
+	-rm -f stamp-automakefiles
 
 if MAINTAINER_MODE
 # This target only makes sense for maintainers!!
@@ -72,6 +73,8 @@ dist-hook:
 	find $(distdir)/DEMO \( -name ellipt -o -name heat -o -name nonlin \) -exec /bin/rm -f {} \;
 	find $(distdir)/DEMO -name Makefile -exec /bin/rm -f {} \;
 
+
+
 #
 # NOTE: you better have GRAPE installed properly before doing this.
 #
@@ -80,9 +83,14 @@ dist-hook:
 # otherwise the grape-interface will not be included into the
 # distribution.
 #
-generate-alberta-dist:
-	./generate-alberta-automakefiles.sh
-	autoreconf
+automakefiles: stamp-automakefiles
+
+stamp-automakefiles: Makefile.am.template generate-alberta-automakefiles.sh
+	cd $(top_srcdir) && ./generate-alberta-automakefiles.sh
+	cd $(top_srcdir) && autoreconf
+	date > stamp-automakefiles
+
+generate-alberta-dist: automakefiles
 	./configure --enable-maintainer-mode --prefix=@prefix@
 	make dist
 endif
diff --git a/Makefile.am.template b/Makefile.am.template
index 709bee3a649bd469a702f1ea2ace8cc00f205f65..6b60b88e2489bcd2c5ccd93beccd4db618fb48b8 100644
--- a/Makefile.am.template
+++ b/Makefile.am.template
@@ -1,4 +1,13 @@
-## Makefile.am for libALBERTA%LIBCODE%
+# Makefile.am for libALBERTA%LIBCODE%
+
+###############################################################################
+#
+#                          DO NOT EDIT!
+#
+# Generated automatically from Makefile.am.template in the top-level
+# ALBERTA distribution directory.
+#
+###############################################################################
 
 DIM_OF_WORLD = %DIM_OF_WORLD%
 EL_INDEX = %EL_INDEX%
@@ -15,3 +24,12 @@ nodist_libALBERTA%LIBCODE%_la_SOURCES = $(sources)
 if HAVE_GLTOOLS
 nodist_libALBERTA%LIBCODE%_la_SOURCES += ../Common/gltools.c
 endif
+
+# NOTE: versioning should _not_ reflect the package release number.
+#
+# This is CURRENT:REVISION:AGE, meaning that this library supports ABI
+# (CURRENT - AGE) to CURRENT, and REVISION is just incremented any
+# time something is changed (e.g. bug-fixes). When CURRENT is
+# incremented, REVISION is reset to 0. See libtool info manual.
+#
+libALBERTA%LIBCODE%_la_LDFLAGS = -version-info 0:0:0
diff --git a/configure.ac b/configure.ac
index e1eb7e380516cc26aa31ad0789b20ce6d2d9d2e2..b4a46617061fde15164abacc4c5125fe34daf298 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.52)
-AC_INIT([alberta], [2.0], [claus@mathematik.uni-freiburg.de,koester@math.uni-augsburg.de])
+AC_INIT([alberta2], [2.0], [claus@mathematik.uni-freiburg.de,koester@math.uni-augsburg.de])
 
 AC_CONFIG_SRCDIR([ALBERTA/src/Common/alberta.h])
 AM_MAINTAINER_MODE
@@ -104,7 +104,7 @@ dnl set default debugging flags, but allow for user-override
 dnl
 if test -z "${ALBERTA_DEBUG_CFLAGS}"; then
 	if test "$GCC" = yes; then
-		ALBERTA_DEBUG_CFLAGS="-O0 -ggdb -fno-inline -fno-builtin"
+		ALBERTA_DEBUG_CFLAGS="-O0 -g3 -gdwarf-2 -fno-inline -fno-builtin"
 	else
 		ALBERTA_DEBUG_CFLAGS="-g"
 	fi
@@ -113,11 +113,13 @@ AC_ARG_VAR([ALBERTA_DEBUG_CFLAGS],[Compiler-flags used to create the debug-enabl
 dnl
 dnl ****************************************************************************
 dnl
-dnl set default optimizing flags, but allow for user-override
+dnl Set default optimizing flags, but allow for user-override.
+dnl With gcc, provide basic debugging facilities even with optimized
+dnl code.
 dnl
 if test -z "${ALBERTA_OPTIMIZE_CFLAGS}"; then
 	if test "$GCC" = yes; then
-		ALBERTA_OPTIMIZE_CFLAGS="-O3"
+		ALBERTA_OPTIMIZE_CFLAGS="-O3 -g"
 	else
 		ALBERTA_OPTIMIZE_CFLAGS="-O"
 	fi