Section 30. The department may make all contracts and agreements and do all other things necessary to co-operate with the United States in the construction and maintenance of highways, under an act of congress approved on July eleventh, nineteen hundred and sixteen, entitled ''An Act to provide that the United States shall aid the states in the construction of rural post roads, and for other purposes'', as amended and supplemented, and submit such plans, estimates and programs for the improvement of highways as will meet the requirements of the secretary of commerce under said act, and it may use therefor any funds which may be available for the construction and maintenance of state highways, and may make any agreements or contracts that may be required to secure federal aid in the construction of highways under the provisions of the act of congress aforesaid, and of all other acts in amendment thereof, or in addition thereto, and may, in such agreements or contracts, provide, among other things, for such labor preferences to honorably discharged soldiers, sailors and marines as are made necessary by federal legislation, and may provide that no other preference or discrimination among citizens of the United States shall be made in connection with the expenditure of any money received from the federal government by virtue of the said legislation, and also any money received from the United States on account of the construction of highways. The department may also, for the purpose of securing federal aid, use any money appropriated by a county, city or town for the construction of a way or any part thereof for which federal aid may be secured, and make contracts or agreements involving the expenditure of said money, provided the county commissioners or the selectmen or duly authorized officials of the city or town have agreed in writing to pay the money thus appropriated upon the order of the department. The department may also maintain the roads constructed under this section or said act of congress, from any money appropriated by the general court for the maintenance of state highways or for the repair or maintenance of other public ways.