adaptation for Mac OS X

modify linker option for Mac OS X,
fix type mismatch, and
add including missing file which should be included.
Merge pull request #1 from tell/adapt-to-mac

adaptation for Mac OS X