Improved makefile; improved readlines when requested number of lines is too big or non-positive