--- gamin-0.1.10/configure.in.orig	2014-09-26 12:01:20.799200000 +0400
+++ gamin-0.1.10/configure.in	2014-09-26 12:07:42.214200000 +0400
@@ -453,6 +453,7 @@
 
 PYTHON_VERSION=
 PYTHON_INCLUDES=
+PYTHON_LIBS=
 PYTHON_SITE_PACKAGES=
 PYTHON_TESTS=
 pythondir=
@@ -479,6 +480,7 @@
     if test "$PYTHON" != ""
     then
         PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
+        PYTHON_LIBS=`python$PYTHON_VERSION-config --ldflags`
 	echo Found Python version $PYTHON_VERSION
     fi
     if test "$PYTHON_VERSION" != ""
@@ -527,6 +529,7 @@
 AC_SUBST(pythondir)
 AC_SUBST(PYTHON_VERSION)
 AC_SUBST(PYTHON_INCLUDES)
+AC_SUBST(PYTHON_LIBS)
 AC_SUBST(PYTHON_SITE_PACKAGES)
 
 dnl After all config-related tweaking of CFLAGS, set it to its "build" value
--- gamin-0.1.10/python/Makefile.am.orig	2014-09-26 12:09:39.370200000 +0400
+++ gamin-0.1.10/python/Makefile.am	2014-09-26 12:09:45.157800000 +0400
@@ -11,7 +11,7 @@
 
 _gamin_la_SOURCES = gamin.c
 _gamin_la_LIBADD = $(top_builddir)/libgamin/libgamin-1.la
-_gamin_la_LDFLAGS = -module -avoid-version -no-undefined
+_gamin_la_LDFLAGS = $(PYTHON_LIBS) -module -avoid-version -no-undefined
 
 python_PYTHON = gamin.py
 
