on linux/gcc use weak definitions to avoid linking with pthread library on

* Makefile.am configure.in threads.c: on linux/gcc use weak definitions
  to avoid linking with pthread library on non-threaded environments.
* xpath.c: applied patch from Mark Vakoc w.r.t. a buggy namespace
  list allocation.
Daniel
diff --git a/Makefile.am b/Makefile.am
index 63ad904..8c0fdfe 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -82,7 +82,7 @@
 testThreads_SOURCES=testThreads@THREADS_W32@.c
 testThreads_LDFLAGS = 
 testThreads_DEPENDENCIES = $(DEPS)
-testThreads_LDADD= $(LDADDS)
+testThreads_LDADD= @BASE_THREAD_LIBS@  $(LDADDS)
 
 testURI_SOURCES=testURI.c
 testURI_LDFLAGS =