get back to --with-<lib>-dir=..., fix #1518, fix #1519, update #674