diff --git a/Eval.lhs b/Eval.lhs
--- a/Eval.lhs
+++ b/Eval.lhs
@@ -13,6 +13,7 @@
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+> {-# LANGUAGE CPP #-}
 > module Eval (Target(..), Stem(..), eval, evalNoMeta, Eval.isStale, substituteStem) where
 >
 > import Parse
@@ -46,6 +47,7 @@
 
 > defaultShell = "/bin/sh"
 
+#if ! MIN_VERSION_mtl(2,0,0)
 > instance Monad m => Applicative (StateT s m) where
 >     pure = return
 >     (<*>) = ap
@@ -53,6 +55,7 @@
 > instance (Monoid w, Monad m) => Applicative (WriterT w m) where
 >     pure = return
 >     (<*>) = ap
+#endif
 
 Targets are either regular files, virtual or patterns. After instantiation of
 meta-rules the patterns disappear, leaving only files and virtual targets. But
diff --git a/hmk.cabal b/hmk.cabal
--- a/hmk.cabal
+++ b/hmk.cabal
@@ -1,5 +1,5 @@
 name:           hmk
-version:        0.9.7
+version:        0.9.7.1
 author:         Mathieu Boespflug
 maintainer:     Mathieu Boespflug <mboes@tweag.net>
 homepage:       http://www.github.com/mboes/hmk
@@ -41,5 +41,5 @@
     extensions:	     PatternGuards, NamedFieldPuns, RecursiveDo
     build-depends:   base < 5, bytestring, containers,
                      directory, process, unix, filepath >= 1.1,
-                     mtl, parsec >= 3.0.0, pcre-light >= 0.3
+                     mtl >= 1.1 && <= 2.0, parsec >= 3.0.0, pcre-light >= 0.3
                      
