Changed the position of libraries in gcc command

The previous order didn't comile under Ubuntu Linux...

This should not be a problem for other distributions.