解決しました。
libpngはver 1.2.8 と 1.0.18 があり
http://www.libpng.org/pub/png/libpng.html
1.0.18をいれてからGDをmakeしなおしてMRTGを入れなおしたら直りました