Changing technology, political turmoil and competition from China are cutting into profits and forcing carmakers to cut jobs and close factories.