diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8ed064eb1de0ebce012daf328173b420ada0f0a4..01db361b08108d79985190700a13bf5c09eafe4f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -79,7 +79,8 @@ endif()
 
 # set Debug/Release options
 set( CMAKE_CXX_FLAGS "-std=c++11 -pthread -Wall -Wno-unused-local-typedefs -Wno-unused-variable" )
-set( CMAKE_CXX_FLAGS_DEBUG "-g" )
+# -DPACKAGE -DPACKAGE_VERSION are needed for bfd.h, see https://stackoverflow.com/a/11748919
+set( CMAKE_CXX_FLAGS_DEBUG "-g -DPACKAGE -DPACKAGE_VERSION" )
 set( CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -mtune=native -DNDEBUG" )
 #set( CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -mtune=native -DNDEBUG -ftree-vectorizer-verbose=1 -ftree-vectorize -fopt-info-vec-missed -funroll-loops" )
 # pass -rdynamic only in Debug mode