--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -14,7 +14,7 @@
 
 xineplugin_la_SOURCES = plugin.c playlist.c npentry.c
 xineplugin_la_LDFLAGS = -avoid-version -module
-xineplugin_la_LIBADD  = -lpthread $(XINE_LIBS)
+xineplugin_la_LIBADD  = -lpthread $(XINE_LIBS) $(X_LIBS)
 
 
 debug: