Use arch flag conditionally
Remove generated files
Improve libtool support