Как я собрал на Debian 9 для работы с MariaDB:
apt-get install make g++ libbz2-dev libtcmalloc-minimal4 libboost-dev libboost-iostreams-dev libboost-system-dev libboost-system1.62-dev libev-dev libmysql++-dev
ln -s /usr/lib/libtcmalloc_minimal.so.4 /usr/lib/libtcmalloc.so
./configure --with-mysql-lib=/usr/lib/x86_64-linux-gnu --with-ev-lib=/usr/lib/x86_64-linux-gnu --with-boost-libdir=/usr/lib/x86_64-linux-gnu
make
apt-get install make g++ libbz2-dev libtcmalloc-minimal4 libboost-dev libboost-iostreams-dev libboost-system-dev libboost-system1.62-dev libev-dev libmysql++-dev
ln -s /usr/lib/libtcmalloc_minimal.so.4 /usr/lib/libtcmalloc.so
./configure --with-mysql-lib=/usr/lib/x86_64-linux-gnu --with-ev-lib=/usr/lib/x86_64-linux-gnu --with-boost-libdir=/usr/lib/x86_64-linux-gnu
make