Simply running "man sqrt" tells you the correct header you should include and the correct library you should link to.