Passing a variable to hyperlink text?

Sure, you only need to concatenate it again. Try:

echo '<a href="' . esc_url( $link ) . '">' . $link . '</a>';