pdflatex dependencies

Some pdflatexs write *.fls to output directory.
pdflatex output

Derive output file name from first LaTeX file name.
pdflatex dependency

Fix derived name for .fls file. Some versions of
pdflatex write .fls in base catalog, while other
write it to output directory.

Sort and remove duplicate entries in dependency
rule.