What if all the SCOTUS justices needed replaced?

The ranks of the Senate can be replenished with gubernatorial appointees very quickly. The Speaker of the House comes right after the Vice-President so the surviving representatives could elect a new Speaker who would then immediately be sworn into office as President and resign from Congress. Assuming “a Majority of each shall constitute a Quorum to do Business” in Article I, Section 5, Clause 1 refers only to members living & sworn into office and vacant seats don’t count then the solve surviving member would be able to elect himself Speaker and assume the Presidency.