--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -53,7 +53,7 @@
 gxine_LDADD = $(XINE_LIBS) $(GTK2_LIBS) $(GTHREAD2_LIBS) \
 	      $(JS_LIBS) $(HAL_LIBS) $(UDEV_LIBS) $(DBUS_LIBS) $(LIRC_LIBS) \
 	      $(X_LIBS) $(X_EXTRA_LIBS) $(XEXT_LIBS) $(XTEST_LIBS) \
-	      $(XINERAMA_LIBS) $(XRANDR_LIBS) $(XCB_LIBS)
+	      $(XINERAMA_LIBS) $(XRANDR_LIBS) $(XCB_LIBS) -ldl -lm
 
 gxine_client_SOURCES = client.c console_output.c