how to make find_rule thread safe
#define MAXLINE 256

typedef struct action_node {
    char **args;  // An array of strings suitable to be passed to execvp
    struct action_node *next_act;
} Action;

typedef struct dep_node {
    struct rule_node *rule;
    struct dep_node *next_dep;
} Dependency;

typedef struct rule_node {
    char *target;
    Dependency *dependencies;
    Action *actions;
    struct rule_node *next_rule;
} Rule;

/* Return a pointer to the rule with the given target. If the target doesn't exist, return null.
 */
Rule *find_rule(Rule **rule_head, char target[MAXLINE]) {
    Rule *curr_rule = *rule_head;
    while (curr_rule != NULL) {
        if (strcmp(curr_rule->target, target) == 0) {
            return curr_rule;
        }
        curr_rule = curr_rule->next_rule;
    }
    return NULL;
}