Formation of Intermetallic Phases in Ion Implantation