Use -dylib instead of -shared

Still need to make this choice automatically.