Added ${CMAKE_DL_LIBS} and newline fix.