Modify to work with Mac OS X.

We modified cods to work with Mac OS X!
And we also change compile option to build in Mac OS X.
This option is more general for many computers.
Would you like to try to build using waf?