diff --git a/Makefile b/Makefile
index 1403938..d772309 100644
--- a/Makefile
+++ b/Makefile
@@ -72,6 +72,10 @@ LIBS += $(shell pkg-config --libs uuid)
LIBS += $(shell pkg-config --libs tinyxml2)
LIBS += $(shell mysql_config --libs_r) $(shell python-config --libs) $(shell pkg-config --libs jansson)
+ifeq ($(shell python -c 'import sys; sys.exit(0) if sys.version_info[:2] < (3,8) else print(1)'), 1)
+ LIBS += $(shell python-config --embed)
+endif
+
EPG2VDR_DATA_DIR = "/var/cache/vdr"
ifdef WITH_GTFT