Fix portability issues and the symlink of libi0.

* Manually set compiler flags is not a good idea because that would
  hurt the portability - the most big benifits of using CMake.
  Although I'm not sure whether our code are still portable now,
  it's better to keep this in mind.

* In order to force CMake linking to static libs, the most simple
  way is to set the name of lib file suffix accordingly. E.g. for
  UNIX-based system, you can write
     set(CMAKE_FIND_LIBRARY_SUFFIXES .a .so)
  You will see the output similar to
     -- Found Antlr3 C runtime: /usr/lib64/libantlr3c.a
  As CMake found .a file which is a static lib, it will set the
  appropriate flags to the linker flags.