Added cmake checks for math, dl, and readline library.