Improving Language Model Reasoning with Self-motivated Learning