This partially randomized phase I/II trial studies the best dose and side effects of recombinant human EGF-rP64K/montanide ISA 51 vaccine (CIMAvax) and nivolumab and to see how well they work in treating patients with stage III-IV non-small cell lung cancer. Vaccine therapy, such as CIMAvax vaccine may help slow down and stop tumor growth. Monoclonal antibodies, such as nivolumab, may block a protein needed by tumor cells to grow and spread. Giving CIMAvax vaccine together with nivolumab may work better in treating patients with stage IIIB-IV non-small cell lung cancer.