Automatic button attaching machine