I am receiving a st_mtim: No such file or directory
error

#include <sys/stat.h>


struct stat target_mod_time;
   // struct timespec target_time = target_mod_time->st_mtim;
    if(stat(target, &target_mod_time) == 0){
        printf("successfully got target time");
    } else if(stat(target, &target_mod_time) == -1){
        perror("st_mtim");
        exit(1);
    }
    struct stat st;
    while (target_rule->dependencies != NULL){
        if(stat(dep->rule->target, &st) == 0){
            // comparing the last modified time for the dependency to that of the target
            if(target_mod_time.st_mtim.tv_sec > st.st_mtim.tv_sec){
                //execute the rule's actions
                execute_actions(target_rule);
            } else if (target_mod_time.st_mtim.tv_sec == st.st_mtim.tv_sec){
                if (target_mod_time.st_mtim.tv_nsec > st.st_mtim.tv_nsec){
                   //execute the rule's actions
                   execute_actions(target_rule);
                }
            }
        } else if(stat(dep->rule->target, &st) == -1){
             perror("st_mtim");
             exit(1);
        }
    }
