The president of South Korea has vowed to "never give up" despite lawmakers voting to impeach him after his short-lived declaration of martial law.