update version to 1.2.2
Cleanup code
Detect darwin platform for autotools
FIX for homebrew