diff --git a/Makefile.am b/Makefile.am
index 94aae7a89cb0cebb5cfdbc00f541d9c897a26fbb..8610588f2dcba09f444ed6ae5c3e1db62a25e4f9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -14,10 +14,6 @@ IPOPT_CPP_DIR  = /home/haile/sander/Ipopt-3.3.5/build
 IPOPT_LDADD    = -L$(IPOPT_CPP_DIR)/lib -lipopt -llapack -lblas -lgfortran
 IPOPT_CPPFLAGS = -I$(IPOPT_CPP_DIR)/include -DHAVE_IPOPT_CPP
 
-# Hack around the insufficient build system: add to references
-# to ag-common by hand
-AM_CPPFLAGS += -I../../dune/ag-common
-
 noinst_PROGRAMS = staticrod staticrod2 rod3d dirneucoupling
 
 staticrod_SOURCES = staticrod.cc
diff --git a/dune.module b/dune.module
index e1cc54fcb828e652c4d7aa28727a9368b118f6a7..710dc6715271270bdfaa876782b62eea1d1f7213 100644
--- a/dune.module
+++ b/dune.module
@@ -5,4 +5,4 @@
 #Name of the module
 Module:rods
 #depending on 
-Depends:dune-common dune-grid dune-istl dune-disc
+Depends:dune-common dune-grid dune-istl dune-disc ag-common