On Rehat/Fedora/CentOS:
yum install wget gcc gcc-c++ flex bison make bind bind-libs bind-utils openssl openssl-devel perl quota libaio libcom_err-devel libcurl-devel gd zlib-devel zip unzip libcap-devel cronie bzip2 db4-devel cyrus-sasl-devel perl-ExtUtils-Embed autoconf automake libtool which
Debian
apt-get install gcc g++ make flex bison openssl libssl-dev perl perl-base perl-modules libperl-dev libaio1 libaio-dev zlib1g zlib1g-dev libcap-dev bzip2 automake autoconf libtool cmake pkg-config python which
FreeBSD tends to have everything needed, and the need to run pre-install commands is less common.
Custombuild does require gmake, but will try to install it with dpkg -r or ports if it's missing. If needed:
pkg_add -r gmake perl wget bison flex gd cyrus-sasl2 cmake
The libcom_err-devel package is for CentOS 6, relating to this error.