recompiling php5 with bundled support for gd on ubuntu

After first forgetting to sed -i 's_\(--with-gd=shared\),/usr\( --enable-gd-native-ttf \\\)_\1\2_ debian/rules, I tried a recompile on a 64-bit ubuntu 9.10 for php5.2 on virtualbox with this manual again.
But the process has choked on a call trace ending in child_rip+0x0/0x20

I ran make clean from within the source directory to clean up before recompile but that just said that There is no rule to target 'clean' it.

Up until Ubuntu 9.10 the gd-package provided by the debian installer is the original gd package that does not have the proper image rendering capabilities required by modern standards. Normally you would want to use the php5 package instead. Because of an argument between the Debian and the PHP5 team this wasn't integrated in the deb installer until Ubuntu 10.04 Lucyd Lynx with integrated PHP5.3.
On Debian Lenny proper php-gd functionality is not a problem either because the proper package is available through dotdeb.
But for Ubuntu 9.10 with PHP5.2 specificly no proper prefab packages are available and you need to compile these yourself. Read more in the actual topic:http://www.howtoforge.com/recompiling-php5-with-bundled-support-for-gd-on-ubuntu

I use an Ubuntu 9.10 Karmic server to check if my distributions function on PHP5.2, which is a backwards compatibility requirement in Drupal 7 and default in Drupal 6.
I could switch to Debian but I am still a n00b on that system, hardening a Debian installation is a bit above my pay grade.
Compiling the proper gd-library per the instricutions in the mentioned topic seemed to be the lesser of two evils. But now i'm stuck anyway. Maybe someone else has run into this and knows what i should do or what it's caused by. My user has sudo rights and i ran the compilation with -rfakeroot.