create linked list of rules, each with their own linked list of dependencies. 

Read and append dependency at the end of the rule's linked list. 
If the target of a dependency does not exist, create new rule.
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;

char *token = strtok(line, s);
strtok(NULL, s);

Rule *rule = malloc(sizeof(Rule));
        rule->dependencies = NULL;
        rule->actions = NULL;
        
        // Head checker - for the first loop iteration
        if(head == NULL){
            head = rule;
        }

        strncpy(rule->target, token, MAXLINE);
        token = strtok(NULL, s);
        
        // for each dependency:
        while(token != NULL){
            
            //create new dependency
            Dependency *new_dep = malloc(sizeof(Dependency));
            new_dep->next_dep = NULL;
            
            //append dep. at end (or edge-case when empty)
            if(rule->dependencies == NULL){
                rule->dependencies = new_dep;
            } else {
                Dependency *curr = rule->dependencies;
                while(curr->next_dep != NULL){
                    curr = curr->next_dep;
                }
                curr->next_dep = new_dep;
            }

            //go through the rule list
            Rule *curr = head;
            while(curr != NULL && curr->target != token){
                curr = curr->next_rule;
            }
            //if target exists, save Rule into new dependency of og. rule
            if(curr != NULL){
                new_dep->rule = curr;
            } else {
                //if no, create new Rule, save pointer into new dependency
                Rule *new_rule = malloc(sizeof(Rule));
                strncpy(new_rule->target, token, MAXLINE); 
                new_dep->rule = new_rule;
                rule->next_rule = new_rule;
            }

            //read next dependency
            token = strtok(NULL, s);
        } ;