build: use gcc-provided ar, nm and ranlib where appropriate