diff --git a/Setup.hs b/Setup.hs
--- a/Setup.hs
+++ b/Setup.hs
@@ -142,7 +142,7 @@
                        Nothing     -> "--link-static"
                        Just shared -> if shared then "--link-shared" else "--link-static"
       libs       <- getLibs ["--libs", linkFlag]
-      systemLibs <- getLibs ["--system-libs"]
+      systemLibs <- getLibs ["--system-libs", linkFlag]
 
       let genericPackageDescription' = genericPackageDescription {
             condLibrary = do
diff --git a/llvm-hs.cabal b/llvm-hs.cabal
--- a/llvm-hs.cabal
+++ b/llvm-hs.cabal
@@ -1,5 +1,5 @@
 name: llvm-hs
-version: 4.0.0.0
+version: 4.0.1.0
 license: BSD3
 license-file: LICENSE
 author: Anthony Cowley, Stephen Diehl, Moritz Kiefer <moritz.kiefer@purelyfunctional.org>, Benjamin S. Scarlet
