You need the prerequisites mentioned in the README file.
In reply to Re: Can't install GD on Ubuntu by marto in thread Can't install GD on Ubuntu by Anonymous Monk