Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 libxs (1.0.1-1) unstable; urgency=low
 .
   * Initial release; closes: #664556.
Author: Robert S. Edmonds <edmonds@debian.org>
Bug-Debian: http://bugs.debian.org/664556

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- libxs-1.0.1.orig/configure.ac
+++ libxs-1.0.1/configure.ac
@@ -358,7 +358,6 @@ if test "x$with_system_pgm_ext" != "xno"
         PKG_CHECK_MODULES([OpenPGM], [openpgm-5.1 >= 5.1])
         AC_DEFINE(XS_HAVE_OPENPGM, 1, [Have OpenPGM extension])
         LIBXS_EXTRA_CXXFLAGS="$OpenPGM_CFLAGS $LIBXS_EXTRA_CXXFLAGS"
-        LIBS="$OpenPGM_LIBS $LIBS"
     ],
     [AC_MSG_ERROR([--with-system-pgm requires a working pkg-config installation])])
 fi
--- libxs-1.0.1.orig/src/Makefile.am
+++ libxs-1.0.1/src/Makefile.am
@@ -149,6 +149,8 @@ libxs_la_CXXFLAGS = @LIBXS_EXTRA_CXXFLAG
 if BUILD_PGM
 libxs_la_CPPFLAGS = -I$(top_srcdir)/@pgm_srcdir@/include/
 libxs_la_LIBADD = $(top_srcdir)/@pgm_srcdir@/libpgm_noinst.la
+else
+libxs_la_LIBADD = $(OpenPGM_LIBS)
 endif
 
 if BUILD_LIBZMQ
