diff --git a/Makefile b/Makefile
index 6bb1b96..118e379 100644
--- a/Makefile
+++ b/Makefile
@@ -62,21 +62,10 @@ VERSION = $(shell grep 'static const char VERSION\[\] *=' $(PLUGIN).c | awk '{ p
 
 ### The directory environment:
 
-# Use package data if installed...otherwise assume we're under the VDR source directory:
-PKGCFG   = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell pkg-config --variable=$(1) vdr || pkg-config --variable=$(1) ../../../vdr.pc))
-LIBDIR   = $(call PKGCFG,libdir)
-LOCDIR   = $(call PKGCFG,locdir)
-MANDIR   = $(call PKGCFG,mandir)
-CONFDIR  = $(call PKGCFG,configdir)
-BINDIR   = $(call PKGCFG,bindir)
-#
 TMPDIR ?= /tmp
 
 ### The compiler options:
 
-export CFLAGS   = $(call PKGCFG,cflags)
-export CXXFLAGS = $(call PKGCFG,cxxflags)
-
 ### configuring modules
 ifeq ($(AUTOCONFIG),1)
 	ifeq (exists, $(shell pkg-config libpcre && echo exists))
@@ -92,9 +81,11 @@ ifeq ($(AUTOCONFIG),1)
 	endif
 endif
 
+include $(VDRDIR)/Make.global
+
 ### The version number of VDR's plugin API:
 
-APIVERSION = $(call PKGCFG,apiversion)
+APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
 
 ### The name of the distribution archive:
 
@@ -103,7 +94,7 @@ PACKAGE = vdr-$(ARCHIVE)
 
 ### Includes and Defines (add further entries here):
 
-INCLUDES +=
+INCLUDES += -I$(VDRDIR)/include
 
 DEFINES += 
 
@@ -231,15 +222,19 @@ install-i18n: $(I18Nmsgs)
 
 libvdr-$(PLUGIN).so: $(OBJS)
 	$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(LIBS) -o $@
+	@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
 
 libvdr-$(PLUGIN2).so: $(OBJS2)
 	$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS2) $(LIBS2) -o $@
+	@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
 
 libvdr-$(PLUGIN3).so: $(OBJS3)
 	$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS3) $(LIBS3) -o $@
+	@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
 
 libvdr-$(PLUGIN4).so: $(OBJS4)
 	$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS4) $(LIBS4) -o $@
+	@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
 
 createcats: createcats.o Makefile
 	$(CXX) $(CXXFLAGS) $(LDFLAGS) createcats.o -o $@
