Fixed compilation issues on Linux

The ordering of the compile and linker flags was causing trouble for gcc on Linux - talking about undefined references to all of the OpenCV stuff.

Also seems -arch is an invalid flag on gcc.

Hope these fixes do not conflict with compilation on OSX.

Thanks for the awesome software!