Since you are trying to compile a program for X, you are going to need quite afew libs. First you need gtk and its matching glib, at least, even to run such progs. You#ll also need X-devel libs from /x
To compile C progs you need, binutils, make, gcc, kernel headers and glibc from /a and /d. You must also have:bzip2, findutils, grep, gawk, sed.
You'll probably need more libs just to run it, and you'll have to include them to compile, since the compile will need the includes.
For a smal GUI install I usually include gtk + lib(many progs still are fine with just gtk+, but if you want better graphs, then gtk+2), gdk-pixbuf, libgr, libjpeg, libpng, libungif, lesstif, libtiff, libxml2, libxslt. These will let you run most gtk progs and others without probs.
For compiling, you'll probably want to include these more modern stuff also: autoconf, libtool, m4 and perl. (all work together).
You might have a look at my minimal Install HOWTO'S (starting at 20MB Slack!) at
www.amigolinux.org.