Fix gcc linker errors