diff --git a/CMake/FindCasacore.cmake b/CMake/FindCasacore.cmake
index e4689f7..9068fdd 100644
--- a/CMake/FindCasacore.cmake
+++ b/CMake/FindCasacore.cmake
@@ -17,6 +17,8 @@
 #
 # Variables used by this module:
 #  CASACORE_ROOT_DIR         - Casacore root directory. 
+#  BLAS_LIBS                 - override BLAS library
+#  LAPACK_LIBS               - override LAPACK library
 #
 # Variables defined by this module:
 #  CASACORE_FOUND            - System has Casacore, which means that the
@@ -232,7 +234,21 @@ else(NOT CASACORE_INCLUDE_DIR)
     elseif(${_comp} STREQUAL fits)
       casacore_find_package(CFITSIO REQUIRED)
     elseif(${_comp} STREQUAL scimath_f)
-      casacore_find_package(LAPACK REQUIRED)
+      # If only looking for LAPACK, no library will be added if LAPACK
+      # is part of BLAS, as it is customary nowadays. So look for both
+      # to avoid confusing linker errors on symbols used in headers/templates.
+      if(DEFINED ENV{BLAS_LIBS})
+        set(BLAS_FOUND YES)
+        list(APPEND CASACORE_LIBRARIES $ENV{BLAS_LIBS})
+      else()
+        casacore_find_package(BLAS   REQUIRED)
+      endif()
+      if(DEFINED ENV{LAPACK_LIBS})
+        set(LAPACK_FOUND YES)
+        list(APPEND CASACORE_LIBRARIES $ENV{LAPACK_LIBS})
+      else()
+        casacore_find_package(LAPACK REQUIRED)
+      endif()
     endif(${_comp} STREQUAL casa)
   endforeach(_comp ${_find_components})
 endif(NOT CASACORE_INCLUDE_DIR)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fd1d7c7..4dd733c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,27 +19,61 @@ find_package(CFITSIO REQUIRED)
 find_path(FFTW3_INCLUDE_DIR NAMES fftw3.h)
 
 find_library(GSL_LIB NAMES gsl)
-find_library(GSL_CBLAS_LIB NAMES gslcblas)
+if(DEFINED ENV{CBLAS_LIBS})
+  message(STATUS "Using CBLAS_LIBS from environment: $ENV{CBLAS_LIBS}")
+  set(GSL_CBLAS_LIB $ENV{CBLAS_LIBS})
+else()
+  find_library(GSL_CBLAS_LIB NAMES gslcblas)
+endif()
 find_path(GSL_INCLUDE_DIR NAMES gsl/gsl_version.h)
 
 find_package(Threads REQUIRED)
 find_package(LibXml2 REQUIRED)
 find_package(PNG REQUIRED)
+find_package(Python COMPONENTS Interpreter Development)
+if(NOT Python_FOUND)
+  message(STATUS "Falling back to deprecated Python search.")
+  find_package(PythonInterp REQUIRED)
+  find_package(PythonLibs REQUIRED)
+  set(Python_VERSION ${PYTHON_VERSION_STRING})
+  set(Python_VERSION_MAJOR ${PYTHON_VERSION_MAJOR})
+  set(Python_VERSION_MINOR ${PYTHON_VERSION_MINOR})
+  set(Python_LIBRARIES ${PYTHON_LIBRARIES})
+  set(Python_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
+endif()
+message(STATUS "Using python version ${Python_VERSION}")
 #Prevent accidentally finding old BoostConfig.cmake file from casapy
 set(Boost_NO_BOOST_CMAKE ON)
-#set(PY_VERSION 3)
-#find_package(PythonLibs ${PY_VERSION} REQUIRED)
-find_package(PythonInterp REQUIRED)
-#find_package(PythonLibs ${PYTHON_VERSION_STRING} REQUIRED)
-find_package(PythonLibs 2.7 REQUIRED)
-#message(STATUS "Using python version ${PYTHON_VERSION_STRING}")
 # At least the intrusive_ref_counter needs Boost 1.55 (because the header was moved)
-find_package(Boost 1.55.0 REQUIRED COMPONENTS date_time filesystem python system)
-#find_package(Boost REQUIRED COMPONENTS date_time filesystem python-py36 system)
+# Bumped to 1.67 to be able to use proper python suffix. One attempt
+# to support at least two boost_python naming schemes here.
+set(boostpython python${Python_VERSION_MAJOR}${Python_VERSION_MINOR})
+find_package(Boost 1.67.0 COMPONENTS date_time filesystem ${boostpython} system)
+if(NOT Boost_FOUND)
+  message(STATUS "Falling back to old Boost search.")
+  set(boostpython python)
+  find_package(Boost 1.55.0  REQUIRED COMPONENTS date_time filesystem ${boostpython} system)
+endif()
+
 find_library(FFTW3_LIB fftw3 REQUIRED)
+# Not sure if this is needed everywhere, but I get linker
+# errors with missing symbols if not explicitly linking to fftw3_threads.
+find_library(FFTW3_THREADS_LIB fftw3_threads OPTIONAL)
 enable_language(Fortran OPTIONAL)
-find_package(BLAS REQUIRED)
-find_package(LAPACK REQUIRED)
+if(DEFINED ENV{BLAS_LIBS})
+  message(STATUS "Using BLAS_LIBS from environment: $ENV{BLAS_LIBS}")
+  set(BLAS_FOUND YES)
+  set(BLAS_LIBRARIES $ENV{BLAS_LIBS})
+else()
+  find_package (BLAS REQUIRED)
+endif()
+if(DEFINED ENV{LAPACK_LIBS})
+  message(STATUS "Using LAPACK_LIBS from environment: $ENV{LAPACK_LIBS}")
+  set(LAPACK_FOUND YES)
+  set(LAPACK_LIBRARIES $ENV{LAPACK_LIBS})
+else()
+  find_package (LAPACK REQUIRED)
+endif()
 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
   find_library(RT_LIBRARY rt)
 #  list(APPEND LOFAR_EXTRA_LIBRARIES ${RT_LIBRARY})
@@ -53,7 +87,7 @@ include_directories(${FFTW3_INCLUDE_DIR})
 if(GSL_INCLUDE_DIR)
 	include_directories(${GSL_INCLUDE_DIR})
 endif(GSL_INCLUDE_DIR)
-include_directories(${PYTHON_INCLUDE_DIRS})
+include_directories(${Python_INCLUDE_DIRS})
 
 # The following stuff will set the "rpath" correctly, so that
 # LD_LIBRARY_PATH doesn't have to be set.
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4a36e1c..55713b2 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -235,17 +235,17 @@ set(PYTHON_FILES
 
 set(ALL_LIBRARIES
 	${BLAS_LIBRARIES} ${LAPACK_LIBRARIES}
-	${Boost_SYSTEM_LIBRARY}
-	${Boost_FILESYSTEM_LIBRARY} ${Boost_DATE_TIME_LIBRARY}
-#	${Boost_PYTHON-PY36_LIBRARIES}
-	${Boost_PYTHON_LIBRARIES}
-	${FFTW3_LIB}
+	Boost::system
+	Boost::filesystem
+	Boost::date_time
+	Boost::${boostpython}
+	${FFTW3_THREADS_LIB} ${FFTW3_LIB}
 	${CASACORE_LIBRARIES}
 	${LAPACK_lapack_LIBRARY}
 	${CFITSIO_LIBRARY}
 	${CMAKE_THREAD_LIBS_INIT}
 	${PNG_LIBRARIES} ${LIBXML2_LIBRARIES}
-	${PYTHON_LIBRARIES})
+	${Python_LIBRARIES})
 
 if(GTKMM_FOUND)
 	message(STATUS "GTKMM found.") 
