Fix Clang compile and link errors