This randomized phase II trial studies how well giving erlotinib hydrochloride and cabozantinib-s-malate alone or in combination works as second or third line therapy in treating patient with stage IV non-small cell lung cancer. Erlotinib hydrochloride and cabozantinib-s-malate may stop the growth of tumor cells by blocking some of the enzymes needed for cell growth. It is not yet known whether giving erlotinib hydrochloride together with cabozantinib-s-malate is more effective than erlotinib hydrochloride or cabozantinib-s-malate alone in treating non-small cell lung cancer.