Mybe is a good idea to post the solution.
I had the same problem. If install t the following:
yum install httpd gcc glibc glibc-common gd gd-devel php-devel autoconf automake libtool rpm-build libgd libgd-devel libpng libpng-devel libjpeg libjpeg-devel zlib zlib-devel php-pdo libxml2 devel gd-2.0.35
After this i executed the next commando:
./configure --with-command-group=nagcmd --with-gd-lib=/usr/local/lib/ --with-gd-inc=/usr/include/
I also use this when i upgrade Nagios to a newer version…
works for me.