diff --git a/test/decoupled/2p/Makefile.am b/test/decoupled/2p/Makefile.am
index c9d58eba873ed6e597938a7f8e911fb3557ff88c..e6c9b6224372a16e705de0e227ec07b09ba75a31 100644
--- a/test/decoupled/2p/Makefile.am
+++ b/test/decoupled/2p/Makefile.am
@@ -12,6 +12,7 @@ test_impes_SOURCES = test_impes.cc
 test_impesadaptive_SOURCES = test_impesadaptive.cc
 
 test_impeswithamg_SOURCES = test_impeswithamg.cc
+test_impeswithamg_CXXFLAGS = -DUSE_AMGBACKEND
 
 test_transport_SOURCES = test_transport.cc
 
diff --git a/test/decoupled/2p/test_impesproblem.hh b/test/decoupled/2p/test_impesproblem.hh
index d773b640ad8089578cd53cfc3be018896f1a1fe5..a1bd73b71742b2341f18d1c4b3714e056f9c21b7 100644
--- a/test/decoupled/2p/test_impesproblem.hh
+++ b/test/decoupled/2p/test_impesproblem.hh
@@ -48,7 +48,7 @@
 
 #include<dumux/decoupled/2p/transport/fv/evalcflfluxcoats.hh>
 
-#if HAVE_DUNE_PDELAB
+#ifdef USE_AMGBACKEND
 #include <dumux/linear/amgbackend.hh>
 #endif
 
@@ -128,7 +128,7 @@ SET_TYPE_PROP(IMPESTestProblem, EvalCflFluxFunction, Dumux::EvalCflFluxCoats<Typ
 
 SET_SCALAR_PROP(IMPESTestProblem, ImpetCFLFactor, 0.95);
 
-#if HAVE_DUNE_PDELAB
+#ifdef USE_AMGBACKEND
 // set up an additional problem where the AMG backend is used
 NEW_TYPE_TAG(IMPESTestProblemWithAMG, INHERITS_FROM(IMPESTestProblem));
 // use the AMG backend for the corresponding test
diff --git a/test/implicit/1p/1ptestproblem.hh b/test/implicit/1p/1ptestproblem.hh
index 3068f520d9d9dd1e7b1ba17314cce2cad6933e98..b52ee62df123116912c4f095e3192bebd938bd4a 100644
--- a/test/implicit/1p/1ptestproblem.hh
+++ b/test/implicit/1p/1ptestproblem.hh
@@ -39,7 +39,9 @@
 #include <dumux/implicit/common/implicitporousmediaproblem.hh>
 #include <dumux/material/components/simpleh2o.hh>
 #include <dumux/material/fluidsystems/liquidphase.hh>
+#ifdef USE_AMGBACKEND
 #include <dumux/linear/amgbackend.hh>
+#endif
 
 #include "1ptestspatialparams.hh"
 
@@ -53,8 +55,6 @@ namespace Properties
 NEW_TYPE_TAG(OnePTestProblem, INHERITS_FROM(OneP));
 NEW_TYPE_TAG(OnePTestBoxProblem, INHERITS_FROM(BoxModel, OnePTestProblem));
 NEW_TYPE_TAG(OnePTestCCProblem, INHERITS_FROM(CCModel, OnePTestProblem));
-NEW_TYPE_TAG(OnePTestBoxProblemWithAMG, INHERITS_FROM(OnePTestBoxProblem));
-NEW_TYPE_TAG(OnePTestCCProblemWithAMG, INHERITS_FROM(OnePTestCCProblem));
 
 SET_PROP(OnePTestProblem, Fluid)
 {
@@ -87,9 +87,13 @@ SET_INT_PROP(OnePTestProblem, LinearSolverVerbosity, 0);
 SET_INT_PROP(OnePTestProblem, LinearSolverPreconditionerIterations, 1);
 SET_SCALAR_PROP(OnePTestProblem, LinearSolverPreconditionerRelaxation, 1.0);
 
+#ifdef USE_AMGBACKEND
+NEW_TYPE_TAG(OnePTestBoxProblemWithAMG, INHERITS_FROM(OnePTestBoxProblem));
+NEW_TYPE_TAG(OnePTestCCProblemWithAMG, INHERITS_FROM(OnePTestCCProblem));
 // Solver settings for the tests using AMG
 SET_TYPE_PROP(OnePTestBoxProblemWithAMG, LinearSolver, Dumux::AMGBackend<TypeTag> );
 SET_TYPE_PROP(OnePTestCCProblemWithAMG, LinearSolver, Dumux::AMGBackend<TypeTag> );
+#endif
 
 // Enable gravity
 SET_BOOL_PROP(OnePTestProblem, ProblemEnableGravity, true);
diff --git a/test/implicit/1p/Makefile.am b/test/implicit/1p/Makefile.am
index 1fd82a0f144e3ca1da73ea1964ea3b2523c06fc3..73688b0dfff8358f383a0c3186a5e6e4831c3dbb 100644
--- a/test/implicit/1p/Makefile.am
+++ b/test/implicit/1p/Makefile.am
@@ -4,8 +4,13 @@ noinst_HEADERS = *.hh
 EXTRA_DIST=*reference.vtu *.input grids/*.dgf CMakeLists.txt
 
 test_box1p_SOURCES = test_box1p.cc
+
 test_cc1p_SOURCES = test_cc1p.cc
+
 test_box1pwithamg_SOURCES = test_box1pwithamg.cc
+test_box1pwithamg_CXXFLAGS = -DUSE_AMGBACKEND
+
 test_cc1pwithamg_SOURCES = test_cc1pwithamg.cc
+test_cc1pwithamg_CXXFLAGS = -DUSE_AMGBACKEND
 
 include $(top_srcdir)/am/global-rules