The board of alderpersons shall appoint a town attorney who shall be an attorney at law licensed to engage in the practice of law in North Carolina and who need not be a resident of the town during his tenure. The town attorney shall serve at the pleasure of the board and shall receive such compensation as the board shall determine.