Ok, I got it to compile.. I just had to move the libsprite/libsprite.a before the -lX11 and it compiled fine. Weird stuff with the compiler..