Lateral gene exchanges shape the genomes of amoeba-resisting microorganisms