diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index a570ad7..9f6ea7b 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -121,6 +121,12 @@ $(BUILD_DIR)/%/.stamp_staging_installed:
 	@$(call MESSAGE,"Installing to staging directory")
 	$($(PKG)_INSTALL_STAGING_CMDS)
 	$(foreach hook,$($(PKG)_POST_INSTALL_STAGING_HOOKS),$(call $(hook))$(sep))
+	$(Q)if test -n "$($(PKG)_CONFIG_FIXUP)" ; then \
+		$(call MESSAGE,"Fixing package configuration files") ;\
+		$(SED) "s,^prefix=.*,prefix=$(STAGING_DIR)/usr,g" \
+			-e "s,^exec_prefix=.*,exec_prefix=$(STAGING_DIR)/usr,g" \
+			$(addprefix $(STAGING_DIR)/usr/bin/,$($(PKG)_CONFIG_FIXUP)) ;\
+	fi
 	$(Q)touch $@
 
 # Install to images dir
