Are the tools neccessary to compile gd2 installed (gcc, make, ...) ? Do you have root access to the server ? Please post the output of a phpinfo script (at least the first section showing the system info and the configure arguments. Those configure arguments are the base for recompiling any modules that may depend on the gd2 library. Besides that check if the gd2 php extension already exists. It might be disabled.
Thomas