adaptation for Mac OS X

modify linker option for Mac OS X,
fix type mismatch, and
add including missing file which should be included.