diff --git a/Makefile b/Makefile
index 862e96801c3ca750fb4d548492eb5b517d3711cb..c42997cea221659e9434a8226d42a16b59033a3f 100644
--- a/Makefile
+++ b/Makefile
@@ -196,8 +196,9 @@ ifneq ($(wildcard makeopts),)
 endif
 
 ASTCFLAGS+=$(MENUSELECT_CFLAGS)
-TOPDIR_CFLAGS=-include include/autoconfig.h
-MOD_SUBDIR_CFLAGS=-include ../include/autoconfig.h
+TOPDIR_CFLAGS=-include include/autoconfig.h -Iinclude
+MOD_SUBDIR_CFLAGS=-include ../include/autoconfig.h -I../include -I..
+OTHER_SUBDIR_CFLAGS=-include ../include/autoconfig.h -I../include -I..
 
 #   *CLI> show memory allocations [filename]
 #   *CLI> show memory summary [filename]
@@ -252,7 +253,6 @@ ifeq ($(OSARCH),SunOS)
   ID=/usr/xpg4/bin/id
 endif
 
-INCLUDE+=-Iinclude -I../include -I..
 ASTCFLAGS+=-pipe  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) #-DMAKE_VALGRIND_HAPPY
 ASTCFLAGS+=$(OPTIMIZE)
 
@@ -545,8 +545,8 @@ muted: muted.o
 
 subdirs: 
 	for x in $(MOD_SUBDIRS); do CFLAGS="$(ASTCFLAGS) $(MOD_SUBDIR_CFLAGS)" $(MAKE) -C $$x || exit 1 ; done
-	CFLAGS="$(ASTCFLAGS)" $(MAKE) -C utils
-	CFLAGS="$(ASTCFLAGS) -include ../include/autoconfig.h" $(MAKE) -C agi
+	CFLAGS="$(ASTCFLAGS) $(OTHER_SUBDIR_CFLAGS)" $(MAKE) -C utils
+	CFLAGS="$(ASTCFLAGS) $(OTHER_SUBDIR_CFLAGS)" $(MAKE) -C agi
 
 clean-depend:
 	for x in $(SUBDIRS); do $(MAKE) -C $$x clean-depend || exit 1 ; done
diff --git a/pbx/Makefile b/pbx/Makefile
index 5cc655c0c95a906ee64da4aed06fc47913ac147e..47ff9aa37dc88371d356832647a868c5419e91d2 100644
--- a/pbx/Makefile
+++ b/pbx/Makefile
@@ -59,10 +59,10 @@ ael/aelflex.o: ael/ael_lex.c ../include/asterisk/ael_structs.h ael/ael.tab.h
 ael/aelbison.o: ael/ael.tab.c ael/ael.tab.h ../include/asterisk/ael_structs.h
 	$(CC) $(CFLAGS) -I. -c -o ael/aelbison.o ael/ael.tab.c
 
-ael/ael_lex.c: ael/ael.flex
+ael/ael_lex.c:
 	(cd ael; flex ael.flex)
 
-ael/ael.tab.c ael/ael.tab.h: ael/ael.y
+ael/ael.tab.c ael/ael.tab.h:
 	(cd ael; bison -v -d ael.y)
 
 %.moc : %.h
diff --git a/utils/Makefile b/utils/Makefile
index 4d599069541a5accc75d9f00c055eba476a2d3a5..661d2c85a1a747f5205cb15aa27a99ba2bfb0a2e 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -49,10 +49,10 @@ clean: clean-depend
 	rm -f ast_expr2.o ast_expr2f.o
 
 astman.o: astman.c
-	$(CC) $(CFLAGS) -include ../include/autoconfig.h -c -o $@ $<
+	$(CC) $(CFLAGS) -c -o $@ $<
 
 astman: astman.o ../md5.o
-	$(CC) -D_GNU_SOURCE -o $@ $< ../md5.o -lnewt
+	$(CC) $(CFLAGS) -o $@ $< ../md5.o -lnewt
 
 stereorize: stereorize.o frame.o
 	$(CC) $(CFLAGS) -o stereorize stereorize.o frame.o -lm
@@ -60,10 +60,10 @@ stereorize: stereorize.o frame.o
 .PHONY: ../ast_expr2.c ../ast_expr2f.c ../pbx/ael/aelflex.o ../pbx/ael/aelbison.o ../pbx/pbx_ael.o
 
 ast_expr2.o: ../ast_expr2.c
-	gcc  $(CFLAGS) -include ../include/autoconfig.h -c -o $@ $<
+	gcc  $(CFLAGS) -c -o $@ $<
 
 ast_expr2f.o: ../ast_expr2f.c
-	gcc  $(CFLAGS) -include ../include/autoconfig.h -c -DSTANDALONE -o $@ $<
+	gcc  $(CFLAGS) -c -DSTANDALONE -o $@ $<
 
 check_expr: check_expr.c ast_expr2.o ast_expr2f.o
 	$(CC) $(CFLAGS) -o $@ $^
@@ -72,7 +72,7 @@ aelparse : ../pbx/ael/aelflex.o ../pbx/ael/aelbison.o ../pbx/pbx_ael.o ael_main.
 	$(CC) $(CFLAGS) -g -o aelparse ../pbx/ael/aelflex.o ../pbx/ael/aelbison.o ael_main.o ../pbx/pbx_ael.o ../ast_expr2f.o ../ast_expr2.o
 
 ael_main.o : ael_main.c ../include/asterisk/ael_structs.h
-	$(CC) $(CFLAGS) -include ../include/autoconfig.h -c -g -o ael_main.o ael_main.c
+	$(CC) $(CFLAGS) -c -g -o ael_main.o ael_main.c
 
 ael_main1.o : ael_main.c ../include/asterisk/ael_structs.h
 	$(CC) $(CFLAGS) -c -g  -o ael_main1.o ael_main.c
@@ -85,7 +85,7 @@ testexpr2s: ../ast_expr2f.c ../ast_expr2.c ../ast_expr2.h
 	./testexpr2s expr2.testinput
 
 smsq.o: smsq.c
-	$(CC) $(CFLAGS) -include ../include/autoconfig.h -c -o $@ $<
+	$(CC) $(CFLAGS) -c -o $@ $<
 
 smsq: smsq.o
 	$(CC) $(CFLAGS) -o smsq ${SOL} smsq.o -lpopt