Fix linker bugs in the build with some linux distros

Should be a fix for #48