diff --git a/auxdir/x_ac_databases.m4 b/auxdir/x_ac_databases.m4
index 839dd8ac7cebc4a68a934dd06eee79c0e5285e10..b5c99bde769a0687da086ee432599f117537f238 100644
--- a/auxdir/x_ac_databases.m4
+++ b/auxdir/x_ac_databases.m4
@@ -67,40 +67,28 @@ AC_DEFUN([X_AC_DATABASES],
 		save_CFLAGS="$CFLAGS"
         	CFLAGS="$PGSQL_CFLAGS $save_CFLAGS"
                 
-		AC_CHECK_HEADERS($PGSQL_INCLUDEDIR/libpq-fe.h,
-			 [has_pgsql_header="true"],
-			 [has_pgsql_header="false"])
-	   	if test "$has_pgsql_header" = "true"; then	
-			AC_CHECK_LIB(pq, PQconnectdb, [has_pgsql_lib="true"], [has_pgsql_lib="false"])
-			if test "$has_pgsql_lib" = "true"; then
-       				PGSQL_LIBS=" -lpq"
-	       			save_LIBS="$LIBS"
-        			LIBS="$PGSQL_LIBS $save_LIBS"
-       				AC_TRY_LINK([#include <libpq-fe.h>],[
-          				int main()
-       	  				{
-						PGconn     *conn;
-						conn = PQconnectdb("dbname = postgres");
-       						(void) PQfinish(conn);
-            			        }
-        				],
-					[ac_have_pgsql="yes"],
-					[ac_have_pgsql="no"])
-				LIBS="$save_LIBS"
-       				if test "$ac_have_pgsql" == "yes"; then
-    					AC_MSG_RESULT([PostgreSQL test program built properly.])
-            				AC_SUBST(PGSQL_LIBS)
-					AC_SUBST(PGSQL_CFLAGS)
-					AC_DEFINE(HAVE_PGSQL, 1, [Define to 1 if using PostgreSQL libaries])
-		        	else	
-       					AC_MSG_WARN([*** PostgreSQL test program execution failed.])
-				fi        	
-      			else
-        			AC_MSG_WARN(libpq not found: PostgreSQL support not available)
-			fi			
-   		else	
-			AC_MSG_WARN(libpq-fe.h header not found: PostgreSQL support not available)
-  		fi 
-		CFLAGS="$save_CFLAGS"
-       	fi
+		PGSQL_LIBS=" -lpq"
+	       	save_LIBS="$LIBS"
+        	LIBS="$PGSQL_LIBS $save_LIBS"
+       		AC_TRY_LINK([#include <libpq-fe.h>],[
+          			int main()
+       	  			{
+					PGconn     *conn;
+					conn = PQconnectdb("dbname = postgres");
+       					(void) PQfinish(conn);
+            			}
+        			],
+			[ac_have_pgsql="yes"],
+			[ac_have_pgsql="no"])
+		LIBS="$save_LIBS"
+       		CFLAGS="$save_CFLAGS"
+		if test "$ac_have_pgsql" == "yes"; then
+    			AC_MSG_RESULT([PostgreSQL test program built properly.])
+            		AC_SUBST(PGSQL_LIBS)
+			AC_SUBST(PGSQL_CFLAGS)
+			AC_DEFINE(HAVE_PGSQL, 1, [Define to 1 if using PostgreSQL libaries])
+		else	
+       			AC_MSG_WARN([*** PostgreSQL test program execution failed.])
+		fi        	
+      	fi
 ])
diff --git a/src/common/Makefile.am b/src/common/Makefile.am
index 627b7413ce31cbf97e30d5b91bf56104751ba3ea..68ff83768f10ac48989b1166623105665ba8fd60 100644
--- a/src/common/Makefile.am
+++ b/src/common/Makefile.am
@@ -106,7 +106,6 @@ libspank_la_SOURCES = \
 libcommon_la_LIBADD   = $(SSL_LIBS) -ldl $(PGSQL_LIBS) $(MYSQL_LIBS)
 
 libcommon_la_LDFLAGS  = $(LIB_LDFLAGS) $(SSL_LDFLAGS)
-libcommon_la_LIBS = $(PGSQL_LIBS) $(MYSQL_LIBS)
 libcommon_la_CFLAGS = $(PGSQL_CFLAGS) $(MYSQL_CFLAGS)
 
 global_defaults.c : $(top_builddir)/config.h Makefile
diff --git a/src/common/Makefile.in b/src/common/Makefile.in
index 78362a0a27259fd75e08e1d5c384de15919e402d..96f8b247ac479c0dfb3b769b0141fe8e2bc42279 100644
--- a/src/common/Makefile.in
+++ b/src/common/Makefile.in
@@ -430,7 +430,6 @@ libspank_la_SOURCES = \
 
 libcommon_la_LIBADD = $(SSL_LIBS) -ldl $(PGSQL_LIBS) $(MYSQL_LIBS)
 libcommon_la_LDFLAGS = $(LIB_LDFLAGS) $(SSL_LDFLAGS)
-libcommon_la_LIBS = $(PGSQL_LIBS) $(MYSQL_LIBS)
 libcommon_la_CFLAGS = $(PGSQL_CFLAGS) $(MYSQL_CFLAGS)
 all: all-am