diff --git a/meson.build b/meson.build
index 6a2aac9..bbb991d 100644
--- a/meson.build
+++ b/meson.build
@@ -20,7 +20,7 @@
 # We use guix.scm for development -- see the header of the guix.scm file
 
 project('freebayes', ['cpp', 'c'],
-        version : '1.3.10',
+        version : '1.3.9',
         default_options : ['warning_level=1', 'cpp_std=c++17', 'optimization=3'])
 add_global_arguments('-Wno-maybe-uninitialized', language : 'cpp') # for ttmath warnings
 
@@ -41,23 +41,24 @@ tabixpp_dep = cc.find_library('tabixpp', required: false, static: static_build)
 
 # later versions of vcflib have Variant.hpp in a system subdirectory
 fs = import('fs')
-if fs.is_dir('/usr/include/vcflib')
-  message('Using /usr/include/vcflib dir')
-  vcflib_inc = include_directories('/usr/include/vcflib')
+if fs.is_dir('${PREFIX}/include/vcflib')
+  message('Using ${PREFIX}/include/vcflib dir')
+  vcflib_inc = include_directories('${PREFIX}/include/vcflib')
 else
   vcflib_inc = files()
 endif
 
 if get_option('prefer_system_deps')
-  fastahack_dep = cc.find_library('libfastahack', required: true) # also link in for vcflib
+  fastahack_dep = cc.find_library('libfastahack', required: false) # also link in for vcflib
   fastahack_src = files()
-  smithwaterman_dep = cc.find_library('libsmithwaterman')
-  if fs.is_dir('/usr/include/fastahack')
-    message('Using /usr/include/fastahack dir')
-    fastahack_inc = include_directories('/usr/include/fastahack')
+  smithwaterman_dep = cc.find_library('libsmithwaterman', required: false)
+  if fs.is_dir('${SRC_DIR}/freebayes/contrib/fastahack')
+    message('Using ${SRC_DIR}/freebayes/contrib/fastahack dir')
+    fastahack_inc = include_directories('${SRC_DIR}/freebayes/contrib/fastahack')
   else
     fastahack_inc = files()
   endif
+  multichoose_inc = files()
   vcflib_inc = files()
   vcflib_src = files()
   smithwaterman_inc = files()
@@ -70,6 +71,7 @@ else
   vcflib_dep = dependency('', required : false) # from this tree
   fastahack_dep = dependency('', required : false) # from this tree
   smithwaterman_dep = dependency('', required : false) # from this tree
+  smithwaterman_dep = dependency('', required : false)
 
   vcflib_inc = include_directories('contrib/vcflib-min/include')
   vcflib_src = files(
@@ -174,7 +176,7 @@ freebayes_lib = static_library(
     'freebayes_common',
     [freebayes_common_src, fastahack_src],
     pic: false,
-    include_directories : [incdir, vcflib_inc, smithwaterman_inc, fastahack_inc],
+    include_directories : [incdir, vcflib_inc, smithwaterman_inc, fastahack_inc, multichoose_inc],
     cpp_args : extra_cpp_args,
     dependencies : [vcflib_dep, zlib_dep, lzma_dep, thread_dep, htslib_dep, tabixpp_dep,
                     wfa2lib_dep, seqlib_dep],
@@ -184,12 +186,12 @@ freebayes_lib = static_library(
 if static_build
   link_arguments = '-static'
 else
-  link_arguments = []
+  link_arguments = ['-ltabixpp', '-lwfa2', '-lvcflib']
 endif
 
 executable('freebayes',
            [freebayes_src],
-           include_directories : [incdir, vcflib_inc, fastahack_inc],
+           include_directories : [incdir, vcflib_inc, fastahack_inc, multichoose_inc],
            cpp_args : extra_cpp_args,
            link_args: link_arguments,
            dependencies: [zlib_dep,
