- Get source package: 
apt-get source libjemalloc-dev - Install build depends: 
apt-get build-dep libjemalloc-dev - Go to the source dir and edit 
debian/rulesfile adding the following text: 
override_dh_auto_configure:
        dh_auto_configure -- --enable-debug --enable-fill --enable-prof --enable-stat
- Build packages: 
dpkg-buildpackage