Use LDSHARED configuration from ./configure everywhere

This is a second attempt at fixing this that this time works on Linux.
This cleans up some of the spread around logic of platforms. It still
needs more cleanup by better abstracting this in the configure process.