Fixed Linking Problems with GCC

The option order in the compilation command was causing the code to compile but presenting linking errors when used in Lua.