Here's what I did on my installation.
First, make sure that you have a copy the gd package from
www.boutell.com. Get the source of the old version (1.8.x) and not the 2.x. Webalizer doesnt seem to work with version 2.
extract and compile gd
1. tar xzvf gd-1.8.4.tar.gz
2. cd gd-1.8.4
3. make
4. make install
*another problem with installing gd is that it requires additional libraries for png and jpeg, so make sure you have libpng and libjpeg before installing gd. Read the gd FAQ, it describes how and where to get these additional libs.
extract and compile webalizer
1. tar xjvf webalizer-2.01-10-src.tar.bz2
2. cd webalizer-2.01-10
3. ./configure --with-gd=/usr/local/lib
4. make
5. make install