Fixed a bug in which check_opengl() would add extraneous -opengl flags

Also, moved the libretro gl ports to the end of the build script so that check_opengl() modifies FORMAT_COMPILER_TARGET after the other libretro ports are built to ensure that the platform flag passed to the non-gl libetro cores are correct. This fixes libretro-super on my desktop running Debian 7 x86_64, but it's not perfect. A more ideal solution would be to give the libretro gl cores their own FORMAT_COMPILER_TARGET environment variable altogether. If you are interested, I wouldn't mind creating a second patch that does just that.