Undefined references after a system upgrade

Upgraded to ubuntu 11.10 yesterday, now I can’t get my code compiled.
Get the following errors.
common/lib/init.o: In function startup(container*, unsigned char const*, unsigned char const*, unsigned char const*, unsigned char const*)': /home/image/Desktop/Game-(23-11-2011)/common/src/init.cpp:66: undefined reference togluOrtho2D’
common/lib/texture.o: In function loadSurface(char*)': /home/image/Desktop/Game-(23-11-2011)/common/src/texture.cpp:15: undefined reference toIMG_Load’
collect2: ld returned 1 exit status

glu and SDL_image libs and includes are there, and the compile line worked before the upgrade.
I’m stumped.

Compiling with the following line
g++ -O2 -g engine.cpp -DCHEAT -I/usr/include -I/usr/include/SDL -L/usr/lib/i386-linux-gnu -L/usr/lib -D_GNU_SOURCE=1 -D_REENTRANT -lSDL -lGL -lGLU -lSDL_image -lSDL_mixer -lSDL_ttf common/lib/init.o common/lib/timer.o common/lib/draw.o common/lib/collision.o common/lib/shuffle.o common/lib/generator.o common/lib/path.o common/lib/texture.o common/lib/menu.o common/lib/sound.o common/lib/config.o -o silverspeed-linux

Realised the libs should be linked at the end of the compile line, moved -lSDL -lGL -lGLU -lSDL_image -lSDL_mixer -lSDL_ttf to the end of the line and it compiled and ran perfectly…