fix compilation errors, disable static linking