diff --git a/Changelog.md b/Changelog.md
--- a/Changelog.md
+++ b/Changelog.md
@@ -1,3 +1,8 @@
+# 0.1.3.1
+
+- Fix linking issue `symbol not found in flat namespace '_kSecRandomDefault'`
+  when using splitmix in TH on macOS.
+
 # 0.1.3
 
 - Use system specific entropy/randomess sources to initialise the default generator.
diff --git a/splitmix.cabal b/splitmix.cabal
--- a/splitmix.cabal
+++ b/splitmix.cabal
@@ -1,6 +1,6 @@
 cabal-version:      2.4
 name:               splitmix
-version:            0.1.3
+version:            0.1.3.1
 synopsis:           Fast Splittable PRNG
 description:
   Pure Haskell implementation of SplitMix described in
@@ -95,8 +95,8 @@
         c-sources: cbits-win/init.c
 
       elif (os(osx) || os(ios))
-        c-sources: cbits-apple/init.c
-        ld-options: -framework Security
+        c-sources:  cbits-apple/init.c
+        frameworks: Security
 
       else
         c-sources: cbits-unix/init.c
@@ -238,4 +238,15 @@
   build-depends:
     , base
     , HUnit     >=1.6.0.0 && <1.7
+    , splitmix
+
+test-suite splitmix-th-test
+  default-language: Haskell2010
+  type:             exitcode-stdio-1.0
+  ghc-options:      -Wall -threaded -rtsopts
+  hs-source-dirs:   tests
+  main-is:          splitmix-th-test.hs
+  build-depends:
+    , base
+    , template-haskell
     , splitmix
diff --git a/tests/splitmix-th-test.hs b/tests/splitmix-th-test.hs
new file mode 100644
--- /dev/null
+++ b/tests/splitmix-th-test.hs
@@ -0,0 +1,11 @@
+{-# LANGUAGE TemplateHaskell #-}
+module Main (main) where
+
+import Language.Haskell.TH.Syntax
+
+import System.Random.SplitMix
+
+main :: IO ()
+main = print val where
+    val :: Double
+    val = $(runIO (newSMGen >>= \g -> return (fst (nextDouble g))) >>= lift)
