diff --git a/configure b/configure
index c28eec2f71c9a0c8cb6a48b7d7fe2fea21c80d4a..85631c933210fa32cbd7883e13d0d02b8481f383 100755
--- a/configure
+++ b/configure
@@ -678,9 +678,9 @@ echo "#define restrict $_restrict" >> $TMPH
 
 # build tree in object directory if source path is different from current one
 if test "$source_path_used" = "yes" ; then
-    DIRS="libav libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
-          libavcodec/ppc libavcodec/liba52 libavcodec/mlib tests"
-    FILES="Makefile libav/Makefile libavcodec/Makefile tests/Makefile"
+    DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
+          libavcodec/ppc libavcodec/liba52 libavcodec/mlib tests vhook"
+    FILES="Makefile libavformat/Makefile libavcodec/Makefile tests/Makefile vhook/Makefile"
     for dir in $DIRS ; do
             mkdir -p $dir
     done
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 0ee4f09e4ae25b731fe743be0b1073c417ef6e0f..3bcddebb4a7f625e2663b23e863dd398c14ebc5a 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -4,7 +4,7 @@
 #
 include ../config.mak
 
-VPATH=$(SRC_PATH)/libav
+VPATH=$(SRC_PATH)/libavformat
 
 CFLAGS= $(OPTFLAGS) -Wall -g -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
 
diff --git a/vhook/Makefile b/vhook/Makefile
index 98280e272142addf2bcb2fac8041926a2db58dd0..e6755cc457a86c9c4bac0992a767d1e32cba5990 100644
--- a/vhook/Makefile
+++ b/vhook/Makefile
@@ -2,7 +2,7 @@ include ../config.mak
 
 VPATH=$(SRC_PATH)/vhook
 
-CFLAGS=-fPIC $(OPTFLAGS) -g -Wall -I$(SRC_PATH) -I$(SRC_PATH)/libavformat -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H
+CFLAGS=-fPIC $(OPTFLAGS) -g -Wall -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavformat -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H
 
 ifeq ($(CONFIG_DARWIN),yes)
 SHFLAGS+=-bundle -flat_namespace -undefined suppress