Fix compiler+linker options and associated errors