This is an open-label, phase II study of merestinib in patients with advanced NSCLC with a MET exon 14 mutation or patients with advanced cancer harboring an NTRK1, 2, or 3 rearrangement. Twenty patients with a MET mutation will be evaluated in a single-arm design. A small separate cohort of 5 NTRK patients will be evaluated for exploratory purposes.