Tidying Rules.mk and library setup script