diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index db27a14d8ecc12f72a7ee8dd9d0a1eb9a27a3d5f..2e91588961e1fb6fa6f427fb74b0aca99b698c49 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -497,7 +497,7 @@ ifeq ($(CONFIG_WIN32),yes)
 else
 	install -d $(libdir)
 	install $(INSTALLSTRIP) -m 755 $(SLIBNAME) $(libdir)/libavcodec-$(VERSION)$(SLIBSUF)
-	ln -sf libavcodec-$(VERSION)$(SLIBSUF) $(libdir)/libavcodec$(SLIBSUF)
+	ln -sf $(SLIBPREF)avcodec-$(VERSION)$(SLIBSUF) $(libdir)/$(SLIBNAME)
 	$(LDCONFIG) || true
 endif
 ifeq ($(CONFIG_PP),yes)