diff --git a/configure.ac b/configure.ac
index 4fb822ea20322bf78a11e48206fa37d0181c1390..9b3b6710fdb87cdb7222c68eba694f006fa383bd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,9 +18,6 @@ AM_INIT_AUTOMAKE([no-define foreign tar-ustar])
 
 AM_MAINTAINER_MODE
 
-ACLOCAL_AMFLAGS='-I $(top_srcdir)'
-AC_SUBST(ACLOCAL_AMFLAGS)
-
 AC_PROG_CC
 AC_PROG_CPP
 AC_PROG_LIBTOOL
@@ -31,7 +28,7 @@ AC_PROG_LIBTOOL
 DC_DOVECOT
 DC_DOVECOT_MODULEDIR
 LIBDOVECOT_INCLUDE="$LIBDOVECOT_INCLUDE $LIBDOVECOT_STORAGE_INCLUDE"
-CFLAGS="$DOVECOT_CFLAGS"
+CFLAGS="$DOVECOT_CFLAGS -I\$(top_srcdir)"
 LIBS="$DOVECOT_LIBS"
 AC_SUBST(LIBDOVECOT_INCLUDE)