Use cmake to build openal and fix some bugs