diff --git a/Makefile b/Makefile
index bf00a3e72cab3c78cae336086a15c298faa34f71..7d3f075e899763c6812146c91e13992e2c3642af 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ include config.mak
 
 VPATH=$(SRC_PATH)
 
-CFLAGS=$(OPTFLAGS) -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavutil \
+CFLAGS=$(OPTFLAGS) -I$(BUILD_ROOT) -I$(SRC_PATH) -I$(SRC_PATH)/libavutil \
        -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat \
        -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE
 LDFLAGS+= -g
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index e091dba8d00593139a217a5d61dcb3eb868d3fe1..ac1c88bd29b257898de872dfdc9bd5145f4fe3b6 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -4,8 +4,7 @@
 #
 include ../config.mak
 
-# NOTE: -I.. is needed to include config.h
-CFLAGS=-DHAVE_AV_CONFIG_H -I.. -I$(SRC_PATH)/libavutil $(OPTFLAGS) \
+CFLAGS=-DHAVE_AV_CONFIG_H -I$(BUILD_ROOT) -I$(SRC_PATH)/libavutil $(OPTFLAGS) \
        -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE $(AMR_CFLAGS)
 
 OBJS= bitstream.o \
diff --git a/libavformat/Makefile b/libavformat/Makefile
index a9a4632e0a455e6b440692069d94ee4b16561cd8..00048892ee947578da4473e6de392af929c57548 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -4,7 +4,7 @@
 #
 include ../config.mak
 
-CFLAGS=-I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavutil -I$(SRC_PATH)/libavcodec \
+CFLAGS=-I$(BUILD_ROOT) -I$(SRC_PATH) -I$(SRC_PATH)/libavutil -I$(SRC_PATH)/libavcodec \
        $(OPTFLAGS) -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 \
        -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE
 
diff --git a/libavutil/Makefile b/libavutil/Makefile
index 045041465fc058be3448473c1daf618258e237ac..b46c6271c07f0c0c78264270eb57ecfce7169bcc 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -3,8 +3,7 @@
 #
 include ../config.mak
 
-# NOTE: -I.. is needed to include config.h
-CFLAGS=-DHAVE_AV_CONFIG_H -DBUILD_AVUTIL -I.. $(OPTFLAGS) \
+CFLAGS=-DHAVE_AV_CONFIG_H -DBUILD_AVUTIL -I$(BUILD_ROOT) $(OPTFLAGS) \
        -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE
 
 OBJS= mathematics.o \
diff --git a/libpostproc/Makefile b/libpostproc/Makefile
index 7a10860c4e624387fef3de47eb20f063f5a8dfee..f7619c31feb480c285053a7a5c802dbda96a2436 100644
--- a/libpostproc/Makefile
+++ b/libpostproc/Makefile
@@ -15,7 +15,7 @@ SHARED_OBJS=postprocess_pic.o
 
 HEADERS = postprocess.h
 
-CFLAGS  = -I.. -I$(SRC_PATH)/libavutil $(OPTFLAGS)
+CFLAGS  = -I$(BUILD_ROOT) -I$(SRC_PATH)/libavutil $(OPTFLAGS)
 
 include $(SRC_PATH)/common.mak
 
diff --git a/vhook/Makefile b/vhook/Makefile
index f6ce7f996cc0be5648f5fc17fd0816270f67c723..808ac56ceb86e573dfbfe224e48bf561cb8e1ac8 100644
--- a/vhook/Makefile
+++ b/vhook/Makefile
@@ -2,7 +2,7 @@ include ../config.mak
 
 VPATH=$(SRC_PATH)/vhook
 
-CFLAGS=-I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavutil -I$(SRC_PATH)/libavcodec \
+CFLAGS=-I$(BUILD_ROOT) -I$(SRC_PATH) -I$(SRC_PATH)/libavutil -I$(SRC_PATH)/libavcodec \
        -I$(SRC_PATH)/libavformat $(VHOOKCFLAGS) -DHAVE_AV_CONFIG_H
 LDFLAGS+= -g