diff --git a/Makefile b/Makefile
index 74f6ad22615637d68efbac1ccdd140a84723202e..fd0dfd7c4167ed248f680a5f1ee37247c176115a 100644
--- a/Makefile
+++ b/Makefile
@@ -35,10 +35,6 @@ ALLPROGS=$(addsuffix $(EXESUF), $(BASENAMES))
 ALLPROGS_G=$(addsuffix _g$(EXESUF), $(BASENAMES))
 ALLMANPAGES=$(addsuffix .1, $(BASENAMES))
 
-ifeq ($(CONFIG_AUDIO_BEOS),yes)
-EXTRALIBS+=-lmedia -lbe
-endif
-
 ifeq ($(BUILD_SHARED),yes)
 DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(SLIBPREF)avformat$(SLIBSUF)
 else
diff --git a/configure b/configure
index 41104a0a34d51b65d11e21d0c47f5b53f237c961..bab60829c085dc9c86130d6c8047dd7338de4da5 100755
--- a/configure
+++ b/configure
@@ -1540,6 +1540,10 @@ if enabled vhook; then
     check_ldflags -export-dynamic
 fi
 
+if enabled audio_beos; then
+    add_extralibs "-lmedia -lbe"
+fi
+
 ##########################################
 # imlib check