Some fixes for compilation
Fix static lib target