link with libs in correct order