Ensure lib and log directories exist