Move the -l libraries to the end of linker command line to solve the build issue by gcc 4.7.2 on ubuntu.