Computing the Characteristic Polynomial of Threshold Graphs