An extended Craig-Bampton method for the modal analysis of mechanisms