diff --git a/be/src/exec/CMakeLists.txt b/be/src/exec/CMakeLists.txt
index 87d3b1a..84de0be 100644
--- a/be/src/exec/CMakeLists.txt
+++ b/be/src/exec/CMakeLists.txt
@@ -110,6 +110,11 @@ add_library(Exec
 
 add_dependencies(Exec gen-deps)
 
+if (BUILD_SHARED_LIBS)
+  target_link_libraries(Exec Boost::filesystem)
+endif ()
+
+
 add_library(ExecTests STATIC
   acid-metadata-utils-test.cc
   delimited-text-parser-test.cc
diff --git a/be/src/runtime/CMakeLists.txt b/be/src/runtime/CMakeLists.txt
index cff6b3f..de2d2a4 100644
--- a/be/src/runtime/CMakeLists.txt
+++ b/be/src/runtime/CMakeLists.txt
@@ -89,6 +89,10 @@ add_library(Runtime
 )
 add_dependencies(Runtime gen-deps)
 
+if (BUILD_SHARED_LIBS)
+  target_link_libraries(Runtime Boost::filesystem)
+endif ()
+
 add_library(RuntimeTests STATIC
   coordinator-backend-state-test.cc
   date-test.cc
diff --git a/be/src/service/CMakeLists.txt b/be/src/service/CMakeLists.txt
index 747e83e..3dcb277 100644
--- a/be/src/service/CMakeLists.txt
+++ b/be/src/service/CMakeLists.txt
@@ -45,6 +45,10 @@ add_library(Service
 )
 add_dependencies(Service gen-deps)
 
+if (BUILD_SHARED_LIBS)
+  target_link_libraries(Service Boost::random)
+endif ()
+
 add_library(ServiceTests STATIC
   hs2-util-test.cc
   impala-server-test.cc
diff --git a/be/src/util/CMakeLists.txt b/be/src/util/CMakeLists.txt
index e6d5fc7..5c80418 100644
--- a/be/src/util/CMakeLists.txt
+++ b/be/src/util/CMakeLists.txt
@@ -139,6 +139,10 @@ endif()
 add_library(Util ${UTIL_SRCS})
 add_dependencies(Util gen-deps gen_ir_descriptions)
 
+if (BUILD_SHARED_LIBS)
+  target_link_libraries(Util Boost::filesystem Boost::regex)
+endif ()
+
 add_library(UtilTests STATIC
   benchmark-test.cc
   bitmap-test.cc
@@ -260,4 +264,4 @@ ADD_UNIFIED_BE_LSAN_TEST(uid-util-test "UidUtil.*")
 ADD_BE_LSAN_TEST(webserver-test)
 TARGET_LINK_LIBRARIES(webserver-test mini_kdc)
 ADD_UNIFIED_BE_LSAN_TEST(zip-util-test "ZipUtilTest.*")
-ADD_UNIFIED_BE_LSAN_TEST(tagged-ptr-test "TaggedPtrTest.*")
\ No newline at end of file
+ADD_UNIFIED_BE_LSAN_TEST(tagged-ptr-test "TaggedPtrTest.*")
