diff --git a/Makefile b/Makefile
index 8f37c92..94869aa 100644
--- a/Makefile
+++ b/Makefile
@@ -16,30 +16,18 @@ VERSION = $(shell grep 'static const char \*VERSION *=' vnsi.h | awk '{ print $$
 ### 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)
-PLGCFG = $(call PKGCFG,plgcfg)
 #
 TMPDIR ?= /tmp
 
 ### The compiler options:
 
-export CFLAGS   = $(call PKGCFG,cflags)
-export CXXFLAGS = $(call PKGCFG,cxxflags)
+include $(VDRDIR)/Make.global
 
 ### The version number of VDR's plugin API:
 
-APIVERSION = $(call PKGCFG,apiversion)
-ifeq ($(strip $(APIVERSION)),)
-APIVERSION = $(shell grep 'define APIVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g')
-NOCONFIG := 1
-endif
+APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
 
 # backwards compatibility version < 1.7.34
-API1733 := $(shell if [ "$(APIVERSION)" \< "1.7.34" ]; then echo true; fi; )
-
-ifdef API1733
 
 VDRSRC = $(VDRDIR)
 VDRSRC ?= ../../..
@@ -47,21 +35,8 @@ ifeq ($(strip $(LIBDIR)),)
 LIBDIR = $(VDRSRC)/PLUGINS/lib
 endif
 
-ifndef NOCONFIG
-CXXFLAGS = $(call PKGCFG,cflags)
-CXXFLAGS += -fPIC
-else
 -include $(VDRSRC)/Make.global
 -include $(VDRSRC)/Make.config
-endif
-
-export CXXFLAGS
-else
-
-### Allow user defined options to overwrite defaults:
-
--include $(PLGCFG)
-endif
 
 ### The name of the distribution archive:
 
@@ -74,11 +49,9 @@ SOFILE = libvdr-$(PLUGIN).so
 
 ### Includes and Defines (add further entries here):
 
-ifdef API1733
 INCLUDES += -I$(VDRSRC)/include
-endif
 
-DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -DVNSI_SERVER_VERSION='"$(VERSION)"'
+DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -DVNSI_SERVER_VERSION='"$(VERSION)"' -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
 
 ifeq ($(DEBUG),1)
 DEFINES += -DDEBUG
@@ -94,11 +67,7 @@ OBJS = vnsi.o bitstream.o vnsiclient.o config.o cxsocket.o parser.o parser_AAC.o
 
 ### The main target:
 
-ifdef API1733
-all: install-lib
-else
 all: $(SOFILE)
-endif
 #
 
 ### Implicit rules:
@@ -145,6 +114,7 @@ install-i18n: $(I18Nmsgs)
 
 $(SOFILE): $(OBJS)
 	$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) -o $@
+	@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
 
 install-lib: $(SOFILE)
 	install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION)
