Donsker-Varadhan asymptotics for degenerate jump Markov processes