diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 6f34ca96dcb38b9ee9696cc9704f80b44e3c6adf..feef16c2e37f4a95ca9cc39a86fd649859478098 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -1,7 +1,8 @@
 include $(SUBDIR)../config.mak
 
 NAME = avfilter
-FFLIBS = avcodec avcore avutil swscale
+FFLIBS = avcodec avcore avutil
+FFLIBS-$(CONFIG_SCALE_FILTER) += swscale
 
 HEADERS = avfilter.h