Lawmakers reach tentative deal to fund government