The ffmpeg libraries are a great swiss army knife for anything dealing with audio/video. In fact, you can use the ffmpeg command-line interface to easily convert between MP3 and AAC:
ffmpeg -i <path to MP3 file> <path to AAC file>
This requires that ffmpeg be compiled with FAAC and LAME support. I don't think Ubuntu's ffmpeg libraries include these by default for legal reasons, but there are ways to install MP3 and AAC enabled versions: http://gebaar.blogspot.com/2009/06/howto-easily-enable-mp3-mpeg4-aac-and.html
If you want to use ffmpeg's underlying libraries (libavcodec, libavformat, etc) to code it yourself: http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/api-example_8c-source.html