But the Treasury Department has given GM only until the end of this month to come up with an agreement with creditors , unions and dealers that would cut its costs and debt enough to be viable for the long-term .