diff --git a/dune/istl/paamg/test/.gitignore b/dune/istl/paamg/test/.gitignore
index db77d078d1ad318a7713f237ea7b3d576fdf1a7f..da05f6d0d9d7dabf0db4da3ae388028dd481ebea 100644
--- a/dune/istl/paamg/test/.gitignore
+++ b/dune/istl/paamg/test/.gitignore
@@ -9,7 +9,12 @@ hierarchytest
 amgtest
 pamgtest
 pamg_comm_repart_test
+pthreadamgtest
+pthreadfastamgtest
+pthreadtwoleveltest
 transfertest
+twolevelmethodschwarztest
+twolevelmethodtest
 kamgtest
 fastamg
 
diff --git a/dune/istl/paamg/test/Makefile.am b/dune/istl/paamg/test/Makefile.am
index b30dd945efe36a1766506e9fa31a0e1eb7e0cc20..420f17bf7f9ea0701cb864ae9b7d7c31d44687ba 100644
--- a/dune/istl/paamg/test/Makefile.am
+++ b/dune/istl/paamg/test/Makefile.am
@@ -126,18 +126,18 @@ twolevelmethodtest_LDADD =					\
 	$(LDADD)
 
 pthreadamgtest_SOURCES = pthreadamgtest.cc
-pthreadamgtest_CPPFLAGS = $(AM_CPPFLAGS) $(PTHREADCFLAGS) -DMYAMG="Dune::Amg::AMG<Operator,Vector,Smoother>"
-pthreadamgtest_LDFLAGS = $(AM_LDFLAGS) $(PTHREADCFLAGS)
+pthreadamgtest_CPPFLAGS = $(AM_CPPFLAGS) $(PTHREAD_CFLAGS) -DMYAMG="Dune::Amg::AMG<Operator,Vector,Smoother>"
+pthreadamgtest_LDFLAGS = $(AM_LDFLAGS) $(PTHREAD_CFLAGS)
 pthreadamgtest_LDADD = $(PTHREAD_LIBS) $(LDADD)
 
 pthreadfastamgtest_SOURCES = pthreadamgtest.cc
-pthreadfastamgtest_CPPFLAGS = $(AM_CPPFLAGS) $(PTHREADCFLAGS) -DMYAMG="Dune::Amg::FastAMG<Operator,Vector>"
-pthreadfastamgtest_LDFLAGS = $(AM_LDFLAGS) $(PTHREADCFLAGS)
+pthreadfastamgtest_CPPFLAGS = $(AM_CPPFLAGS) $(PTHREAD_CFLAGS) -DMYAMG="Dune::Amg::FastAMG<Operator,Vector>"
+pthreadfastamgtest_LDFLAGS = $(AM_LDFLAGS) $(PTHREAD_CFLAGS)
 pthreadfastamgtest_LDADD = $(PTHREAD_LIBS) $(LDADD)
 
 pthreadtwoleveltest_SOURCES = pthreadtwoleveltest.cc
-pthreadtwoleveltest_CPPFLAGS = $(AM_CPPFLAGS) $(PTHREADCFLAGS)
-pthreadtwoleveltest_LDFLAGS = $(AM_LDFLAGS) $(PTHREADCFLAGS)
+pthreadtwoleveltest_CPPFLAGS = $(AM_CPPFLAGS) $(PTHREAD_CFLAGS)
+pthreadtwoleveltest_LDFLAGS = $(AM_LDFLAGS) $(PTHREAD_CFLAGS)
 pthreadtwoleveltest_LDADD = $(PTHREAD_LIBS) $(LDADD)
 
 include $(top_srcdir)/am/global-rules
diff --git a/dune/istl/paamg/test/pthreadamgtest.cc b/dune/istl/paamg/test/pthreadamgtest.cc
index 54812de8dce7225b0c5535a8630bedcffab9e408..31f431660d5a847800c724d42d8b8f02500fa72d 100644
--- a/dune/istl/paamg/test/pthreadamgtest.cc
+++ b/dune/istl/paamg/test/pthreadamgtest.cc
@@ -102,7 +102,7 @@ void *solve1(void* arg)
   *amgarg->x=0;
   (*amgarg->amg).apply(*amgarg->x,*amgarg->b);
   (*amgarg->amg).post(*amgarg->x);
-
+  return 0;
 }
 
 void *solve2(void* arg)
@@ -112,6 +112,7 @@ void *solve2(void* arg)
   (*amgarg->amg).pre(*amgarg->x,*amgarg->b);
   (*amgarg->amg).apply(*amgarg->x,*amgarg->b);
   (*amgarg->amg).post(*amgarg->x);
+  return 0;
 }
 
 template <int BS, typename AMG>